Skip to content
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

Supporting Markdown Fenced Code Block #124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sntran
Copy link

@sntran sntran commented Feb 26, 2018

Syntax highlighting inside markdown code blocks:

image

Inspired by https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example

Syntax highlighting inside markdown code blocks:

```elixir
Graph.match(
  from person in "Person",
    where: person.age < 32 and person.title == "Developer",
    join: friend in "Person", on: "FRIEND",
    join: fof, on: "FRIEND",
    join: work, on: "WORKED_WITH",
    select: {person.name, friend.name, fof.name, work.name}
)
```

Inspired by https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example
@timmhirsens
Copy link
Owner

Looking good, will test and merge this soon. Tyvm!

"injectionSelector": "L:markup.fenced_code.block.markdown",
"patterns": [
{
"include": "#plantuml-code-block"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this "plantuml" comming from?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that "plantuml". It was from another snippet. I have pushed an update that does not have it.

Not only we can avoid matching `elixir` anywhere inside the fenced code
block, we also follow the format defined in Visual Studio's
[markdown.tmLanguage.json](https://github.com/Microsoft/vscode/blob/master/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants