Skip to content

Commit

Permalink
fix: embed files error
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Aug 13, 2020
1 parent 2058163 commit 6fd4086
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/embed-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Sometimes you don't want to embed a whole file. Maybe because you need just a fe
[filename](_media/example.js ':include :type=code :fragment=demo')
```

In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment).
In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment).
Alternatively you can use `### [demo]`.

Example:
Expand Down Expand Up @@ -153,7 +153,7 @@ The `LABEL` can be any text you want. It acts as a _fallback_ message if the lin
### Render a codeblock from a gist

The format is the same as the previous section, but with `:type=code` added to the alt text. As with the [Embedded file type](#embedded-file-type) section, the syntax highlighting will be **inferred** from the extension (e.g. `.js` or `.py`), so you can leave the `type` set as `code`.

Here is the format:

```markdown
Expand Down
2 changes: 1 addition & 1 deletion src/core/render/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function prerenderEmbed({ compiler, raw = '', fetch }, done) {
const compile = compiler._marked;
let tokens = compile.lexer(raw);
const embedTokens = [];
const linkRE = compile.InlineLexer.rules.link;
const linkRE = compile.Lexer.rules.inline.link;
const links = tokens.links;

tokens.forEach((token, index) => {
Expand Down

0 comments on commit 6fd4086

Please sign in to comment.