Skip to content

Commit 5bf6788

Browse files
committed
Change info in Code to meta
Related to GH-22. Related to d797ea3.
1 parent 7496bbe commit 5bf6788

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

readme.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,15 @@ Yields:
157157
### `Code`
158158

159159
`Code` ([`Text`][text]) occurs at block level (see
160-
[`InlineCode`][inlinecode] for code spans). `Code` supports an
161-
info string and a language tag (when the line with the opening fence
162-
contains some text, it is stored as the info string, the first word
163-
following the fence is stored as the language tag, the rest of the
164-
line is stored as the info string, both are null if missing)
160+
[`InlineCode`][inlinecode] for code spans). The value after the opening
161+
of fenced code can be followed by a language tag, and then optionally
162+
white-space followed by the meta value.
165163

166164
```idl
167165
interface Code <: Text {
168166
type: "code";
169167
lang: string | null;
170-
info: string | null;
168+
meta: string | null;
171169
}
172170
```
173171

@@ -183,11 +181,32 @@ Yields:
183181
{
184182
"type": "code",
185183
"lang": null,
186-
"info": null,
184+
"meta": null,
187185
"value": "foo()"
188186
}
189187
```
190188

189+
And the following markdown:
190+
191+
````md
192+
```js highlight-line="2"
193+
foo()
194+
bar()
195+
baz()
196+
```
197+
````
198+
199+
Yields:
200+
201+
```json
202+
{
203+
"type": "code",
204+
"lang": "js",
205+
"meta": "highlight-line=\"2\"",
206+
"value": "foo()\bbar()\nbaz()"
207+
}
208+
```
209+
191210
### `InlineCode`
192211

193212
`InlineCode` ([`Text`][text]) occurs inline (see [`Code`][code] for

0 commit comments

Comments
 (0)