@oxide/react-asciidoc 2.1.0 → 2.1.1

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.
@@ -1,4 +1,4 @@
1
1
  export { parseInline, subSpecialchars, subCallouts, subCalloutsRaw } from './parser';
2
2
  export type { ParseOptions, ParseState } from './parser';
3
- export { renderInline, renderInlineAsString } from './renderer';
3
+ export { renderInline, renderInlineAsString, renderInlineAsText } from './renderer';
4
4
  export * from './types';
@@ -1,3 +1,22 @@
1
1
  import { InlineNode } from './types';
2
2
  export declare function renderInline(nodes: InlineNode[], iconsFont?: boolean): string;
3
3
  export declare function renderInlineAsString(nodes: InlineNode[], iconsFont?: boolean): string;
4
+ /**
5
+ * Render an inline AST back to PLAIN TEXT — the substituted source with no HTML
6
+ * markup. This is the verbatim-source counterpart to `renderInlineAsString`: it
7
+ * resolves text-level subs (notably `attributes`) but emits the bare code a
8
+ * syntax highlighter should tokenize rather than HTML5 elements.
9
+ *
10
+ * - `text` nodes: emitted as-is, with `specialcharacters` entities decoded back
11
+ * to literal `< > &` when `decodeEntities` is set (verbatim blocks include
12
+ * `specialcharacters` by default, so normally `true`). `raw` passthrough
13
+ * nodes (`pass:[]` / `+++`) are already-final author HTML — emitted verbatim,
14
+ * never decoded.
15
+ * - `quoted` / `anchor` / `footnote` / `button`: flattened to their inner text.
16
+ * A highlighter wants the code, not `<em>` / `<a>`; these only appear when the
17
+ * author opted into `+quotes` / `+macros` on the block.
18
+ * - `callout`: preserved raw as `<N>` — the highlighter resolves callouts itself.
19
+ * - `break`: a newline.
20
+ * - `image` / `kbd` / `menu` / `indexterm`: no meaningful verbatim text — skipped.
21
+ */
22
+ export declare function renderInlineAsText(nodes: InlineNode[], decodeEntities?: boolean): string;
@@ -99,6 +99,13 @@ export interface LiteralBlock extends BaseBlock {
99
99
  type: 'listing';
100
100
  source: string;
101
101
  language: string | undefined;
102
+ /** `source` with the block's resolved text-level substitutions applied
103
+ * (notably `attributes`), un-escaped and un-highlighted — the plain code a
104
+ * syntax highlighter should tokenize. Equals `source` when the block's subs
105
+ * make no text-level change. Callout markers are preserved in raw `<N>` form
106
+ * (resolve them with `subCalloutsRaw`). Quote/macro subs, if enabled, are
107
+ * flattened to their text. */
108
+ subbedSource: string;
102
109
  }
103
110
  export interface SectionBlock extends BaseBlock {
104
111
  type: 'section';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxide/react-asciidoc",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],