Skip to content

Commit

Permalink
Add info to Code
Browse files Browse the repository at this point in the history
Closes GH-22.

Reviewed-by: Christian Murphy <Christian.Murphy.42@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
arobase-che authored and wooorm committed Aug 20, 2018
1 parent 0d45035 commit d797ea3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,17 @@ Yields:
### `Code`

`Code` ([`Text`][text]) occurs at block level (see
[`InlineCode`][inlinecode] for code spans). `Code` sports a language
tag (when using GitHub Flavoured Markdown fences with a flag, `null`
otherwise).
[`InlineCode`][inlinecode] for code spans). `Code` supports an
info string and a language tag (when the line with the opening fence
contains some text, it is stored as the info string, the first word
following the fence is stored as the language tag, the rest of the
line is stored as the info string, both are null if missing)

```idl
interface Code <: Text {
type: "code";
lang: string | null;
info: string | null;
}
```

Expand All @@ -180,6 +183,7 @@ Yields:
{
"type": "code",
"lang": null,
"info": null,
"value": "foo()"
}
```
Expand Down

0 comments on commit d797ea3

Please sign in to comment.