Skip to content

Add info field to Code block #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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