Skip to content

Commit

Permalink
🔧 Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Mar 1, 2023
1 parent 1bd0def commit f791cea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion myst_parser/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def check_extensions(inst: "MdParserConfig", field: dc.Field, value: Any) -> Non
"fieldlist",
"html_admonition",
"html_image",
"inv_link",
"linkify",
"replacements",
"smartquotes",
Expand Down
4 changes: 2 additions & 2 deletions myst_parser/mdit_to_docutils/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def render_link(self, token: SyntaxTreeNode) -> None:
- If the link is an id link (e.g. `#id`), forward to `render_id_link`
- If the link has a schema, and the schema is in `url_schemes` (e.g. `http:`),
forward to `render_external_url`
- If the link has an `inv:` schema, and `inv_link` is enabled,
- If the link has an `inv:` schema,
forward to `render_inventory_link`
- If the link is an autolink/linkify type link, forward to `render_external_url`
- Otherwise, forward to `render_internal_link`
Expand All @@ -908,7 +908,7 @@ def render_link(self, token: SyntaxTreeNode) -> None:
if scheme in self.md_config.url_schemes:
return self.render_external_url(token, self.md_config.url_schemes[scheme])

if scheme == "inv" and "inv_link" in self.md_config.enable_extensions:
if scheme == "inv":
return self.render_inventory_link(token)

if token.info == "auto":
Expand Down
4 changes: 2 additions & 2 deletions tests/test_renderers/fixtures/myst-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ My paragraph
Chris Sewell
.

[inv_link] --myst-enable-extensions=inv_link
[inv_link]
.
<inv:#index>
[](inv:#index)
Expand Down Expand Up @@ -411,7 +411,7 @@ My paragraph
Title
.

[inv_link_error] --myst-enable-extensions=inv_link
[inv_link_error]
.
<inv:#other>

Expand Down

0 comments on commit f791cea

Please sign in to comment.