@opencode-ai/ui 0.0.0-dev-202607132111 → 0.0.0-dev-202607140024

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ export declare const markedCodeSpanBoundary: {
2
+ tokenizer: {
3
+ inlineText(this: import("marked").Tokenizer<string, string>, src: string): false | {
4
+ type: "text";
5
+ raw: string;
6
+ text: string;
7
+ escaped: boolean;
8
+ };
9
+ };
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode-ai/ui",
3
- "version": "0.0.0-dev-202607132111",
3
+ "version": "0.0.0-dev-202607140024",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -135,7 +135,7 @@
135
135
  "fuzzysort": "3.1.0",
136
136
  "katex": "0.16.27",
137
137
  "luxon": "3.6.1",
138
- "marked": "17.0.1",
138
+ "marked": "17.0.6",
139
139
  "marked-katex-extension": "5.1.6",
140
140
  "marked-shiki": "1.2.1",
141
141
  "morphdom": "2.7.8",
@@ -0,0 +1,17 @@
1
+ import type { MarkedExtension } from "marked"
2
+
3
+ // Keep adjacent tilde and backtick runs separate until markedjs/marked#4011 is released.
4
+ export const markedCodeSpanBoundary = {
5
+ tokenizer: {
6
+ inlineText(src) {
7
+ const match = /^(`+(?=~)|~+(?=`))/.exec(src)
8
+ if (!match) return false
9
+ return {
10
+ type: "text",
11
+ raw: match[0],
12
+ text: match[0],
13
+ escaped: this.lexer.state.inRawBlock,
14
+ }
15
+ },
16
+ },
17
+ } satisfies MarkedExtension
@@ -3,6 +3,7 @@ import markedShiki from "marked-shiki"
3
3
  import katex from "katex"
4
4
  import { bundledLanguages, type BundledLanguage } from "shiki"
5
5
  import { createSimpleContext } from "./helper"
6
+ import { markedCodeSpanBoundary } from "./marked-code-span"
6
7
  import { getSharedHighlighter, registerCustomTheme, ThemeRegistrationResolved } from "@pierre/diffs"
7
8
 
8
9
  export const OpenCodeTheme = {
@@ -521,6 +522,7 @@ export const { use: useMarked, provider: MarkedProvider } = createSimpleContext(
521
522
  name: "Marked",
522
523
  init: (props: { nativeParser?: NativeMarkdownParser }) => {
523
524
  const jsParser = marked.use(
525
+ markedCodeSpanBoundary,
524
526
  {
525
527
  renderer: {
526
528
  link({ href, title, text }) {