@oxide/react-asciidoc 2.1.0 → 2.1.1-canary.b3df79d
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';
|
|
@@ -113,7 +120,6 @@ export interface TableBlock extends BaseBlock {
|
|
|
113
120
|
type: 'table';
|
|
114
121
|
caption: string;
|
|
115
122
|
columns: Column[];
|
|
116
|
-
rows: Row;
|
|
117
123
|
headRows: Cell[][];
|
|
118
124
|
bodyRows: Cell[][];
|
|
119
125
|
footRows: Cell[][];
|
|
@@ -129,11 +135,6 @@ export type Column = {
|
|
|
129
135
|
verticalAlign: string | undefined;
|
|
130
136
|
style: string | undefined;
|
|
131
137
|
};
|
|
132
|
-
export type Row = {
|
|
133
|
-
head: Cell[][];
|
|
134
|
-
body: Cell[][];
|
|
135
|
-
foot: Cell[][];
|
|
136
|
-
};
|
|
137
138
|
export interface Cell extends BaseBlock {
|
|
138
139
|
type: 'table_cell';
|
|
139
140
|
columnSpan: number | undefined;
|
|
@@ -149,9 +150,6 @@ export interface Cell extends BaseBlock {
|
|
|
149
150
|
* serialized HTML string. Undefined for asciidoc/literal cells, which
|
|
150
151
|
* don't go through the inline-string path. */
|
|
151
152
|
contentInlines?: InlineNode[][] | undefined;
|
|
152
|
-
source: string;
|
|
153
|
-
lines: string[];
|
|
154
|
-
column: Column | undefined;
|
|
155
153
|
width: string | undefined;
|
|
156
154
|
columnPercentageWidth: string | undefined;
|
|
157
155
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxide/react-asciidoc",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1-canary.b3df79d",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -67,5 +67,10 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"registry": "https://registry.npmjs.org/",
|
|
69
69
|
"access": "public"
|
|
70
|
+
},
|
|
71
|
+
"allowScripts": {
|
|
72
|
+
"esbuild@0.27.7": true,
|
|
73
|
+
"fsevents@2.3.2": true,
|
|
74
|
+
"fsevents@2.3.3": true
|
|
70
75
|
}
|
|
71
76
|
}
|