Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@ repository:
patterns:
- include: source.yaml

flow:
patterns:
- include: "#table"
- include: "#admonition"
- include: "#details"
- include: "#tab"
- include: "#footnote_definition"
- include: "#reference_definition"
- include: "#abbreviation"
- include: "#math"
- include: "#fenced_code"
- include: "#heading_atx"
- include: "#thematic_break"
- include: "#block_quote"
- include: "#list_item"
- include: "#paragraph"

snippet:
patterns:
- name: meta.snippet.section.markdown
Expand Down Expand Up @@ -189,6 +172,23 @@ repository:
captures:
1: { name: punctuation.whitespace.markdown }

flow:
patterns:
- include: "#table"
- include: "#admonition"
- include: "#details"
- include: "#tab"
- include: "#footnote_definition"
- include: "#reference_definition"
- include: "#abbreviation"
- include: "#math"
- include: "#fenced_code"
- include: "#heading_atx"
- include: "#thematic_break"
- include: "#block_quote"
- include: "#list_item"
- include: "#paragraph"

table:
patterns:
- name: markup.table.markdown
Expand Down
16 changes: 14 additions & 2 deletions integrations/code/src/extension/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ import type { ExtensionContext } from "vscode";
*/
type Project = "MkDocs" | "Zensical";

/* ----------------------------------------------------------------------------
* Data
* ------------------------------------------------------------------------- */

/**
* Tagged documents.
*/
const tagged = new Set<string>();

/* ----------------------------------------------------------------------------
* Functions
* ------------------------------------------------------------------------- */
Expand Down Expand Up @@ -171,6 +180,9 @@ async function tagDocument(
return;
}

// Retag the document as Python Markdown
await vscode.languages.setTextDocumentLanguage(document, "python-markdown");
// Tag the document as Python Markdown
if (!tagged.has(document.uri.toString())) {
tagged.add(document.uri.toString());
await vscode.languages.setTextDocumentLanguage(document, "python-markdown");
}
}
92 changes: 46 additions & 46 deletions integrations/code/syntaxes/python-markdown.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,52 +43,6 @@
}
]
},
"flow": {
"patterns": [
{
"include": "#table"
},
{
"include": "#admonition"
},
{
"include": "#details"
},
{
"include": "#tab"
},
{
"include": "#footnote_definition"
},
{
"include": "#reference_definition"
},
{
"include": "#abbreviation"
},
{
"include": "#math"
},
{
"include": "#fenced_code"
},
{
"include": "#heading_atx"
},
{
"include": "#thematic_break"
},
{
"include": "#block_quote"
},
{
"include": "#list_item"
},
{
"include": "#paragraph"
}
]
},
"snippet": {
"patterns": [
{
Expand Down Expand Up @@ -394,6 +348,52 @@
}
]
},
"flow": {
"patterns": [
{
"include": "#table"
},
{
"include": "#admonition"
},
{
"include": "#details"
},
{
"include": "#tab"
},
{
"include": "#footnote_definition"
},
{
"include": "#reference_definition"
},
{
"include": "#abbreviation"
},
{
"include": "#math"
},
{
"include": "#fenced_code"
},
{
"include": "#heading_atx"
},
{
"include": "#thematic_break"
},
{
"include": "#block_quote"
},
{
"include": "#list_item"
},
{
"include": "#paragraph"
}
]
},
"table": {
"patterns": [
{
Expand Down