From 3f568d945574699dae9496437b483ba912e49eb3 Mon Sep 17 00:00:00 2001 From: Kyle King Date: Mon, 17 Jul 2023 18:24:07 -0400 Subject: [PATCH 1/6] fix: resolve semantic errors Add tests based on #6 and #7 --- tests/fixtures-semantic-indent.md | 302 ++++++++++++++++++ tests/fixtures.md | 42 ++- ...align_semantic_breaks_in_numbered_lists.py | 41 +-- 3 files changed, 355 insertions(+), 30 deletions(-) create mode 100644 tests/fixtures-semantic-indent.md diff --git a/tests/fixtures-semantic-indent.md b/tests/fixtures-semantic-indent.md new file mode 100644 index 0000000..513969a --- /dev/null +++ b/tests/fixtures-semantic-indent.md @@ -0,0 +1,302 @@ + +Dashed list +. +- item 1 + - item 2 +. +- item 1 + - item 2 +. + +Asterisk list +. +* item 1 + * item 2 +. +- item 1 + - item 2 +. + +Numbered list +. +1. item 1 + 1. item 2 + 2. item 2 + 1. item 3 + 2. item 3 +. +1. item 1 + 1. item 2 + 1. item 2 + 1. item 3 + 1. item 3 +. + +Combination list +. +- item 1 + * item 2 + 1. item 3 +. +- item 1 + - item 2 + 1. item 3 +. + +Corrected Indentation from 3x +. +- item 1 + - item 2 + - item 3 + - item 4 +. +- item 1 + - item 2 + - item 3 + - item 4 +. + +Corrected Indentation from 5x +. +- item 1 + - item 2 + - item 3 + - item 4 +. +- item 1 + - item 2 + - item 3 + - item 4 +. + +Handle Jagged Indents 2x +. +- item 1 + - item 2 + - item 3 + - item 4 + - item 5 + - item 6 + - item 7 +- item 8 +. +- item 1 + - item 2 + - item 3 + - item 4 + - item 5 + - item 6 + - item 7 +- item 8 +. + +Handle Jagged Indents 5x +. +- item 1 + - item 2 + - item 3 + - item 4 + - item 5 + - item 6 + - item 7 +- item 8 +. +- item 1 + - item 2 + - item 3 + - item 4 + - item 5 + - item 6 + - item 7 +- item 8 +. + +Handle Mixed Indents +. +- item 1 + - item 2 + - item 3 + - item 4 + - item 5 + - item 6 + - item 7 +- item 8 +. +- item 1 + - item 2 + - item 3 + - item 4 + - item 5 + - item 6 + - item 7 +- item 8 +. + +List with (what should be converted to a) code block +. +- item 1 + + code block +. +- item 1 + + code block +. + +List with explicit code block (that should keep indentation) +. +- item 1 + + ```txt + code block + ``` +. +- item 1 + + ```txt + code block + ``` +. + + +Hanging List (https://github.com/executablebooks/mdformat/issues/371 and https://github.com/KyleKing/mdformat-mkdocs/issues/4) +. +1. Here indent width is + three. + + 2. Here indent width is + three. + +123. Here indent width is + five. It needs to be so, because + + Otherwise this next paragraph doesn't belong in the same list item. +. +1. Here indent width is + three. + + 1. Here indent width is + three. + +1. Here indent width is + five. It needs to be so, because + + Otherwise this next paragraph doesn't belong in the same list item. +. + + +Code block in semantic indent (https://github.com/KyleKing/mdformat-mkdocs/issues/6) +. +1. Item 1 + with a semantic line feed + + ```bash + echo "I get moved around by prettier/mdformat, originally I am 3 spaces deep" + ``` + +1. Item 2 +1. Item 3 +. +1. Item 1 + with a semantic line feed + + ```bash + echo "I get moved around by prettier/mdformat, originally I am 3 spaces deep" + ``` + +1. Item 2 + +1. Item 3 +. + + +Nested semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) +. +1. Line + semantic line 1 (3 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. +1. Line + semantic line 1 (3 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. + + +Table +. +| Label | Rating | Comment | +|:---------------|---------:|:---------------------| +| Name | 2| | +. +| Label | Rating | Comment | +|:---------------|---------:|:---------------------| +| Name | 2| | +. + +Floating Link +. +> Based on [External Link] + +[external link]: https://github.com/czuli/github-markdown-example/tree/7326f19c94be992319394e5bfeaa07b30f858e46 +. +> Based on [External Link] + +[external link]: https://github.com/czuli/github-markdown-example/tree/7326f19c94be992319394e5bfeaa07b30f858e46 +. + +Headings +. +# [h1] The largest heading + +## [h2] heading + +### [h3] heading + +#### [h4] heading + +##### [h5] heading + +###### [h6] The smallest heading +. +# \[h1\] The largest heading + +## \[h2\] heading + +### \[h3\] heading + +#### \[h4\] heading + +##### \[h5\] heading + +###### \[h6\] The smallest heading +. + +Task List / Check List (WARN: escaping is prevented by mdformat-gfm. Tested by py#-hook) +. +- [x] #739 + - [ ] Add delight to the experience when all tasks are complete :tada: +. +- \[x\] #739 + - \[ \] Add delight to the experience when all tasks are complete :tada: +. + +Footnotes (WARN: escaping is prevented by mdformat-gfm. Tested by py#-hook) +. +Here is a simple footnote[^1]. + +You can also use words, to fit your writing style more closely[^note]. + + [^1]: My reference. + [^note]: Named footnotes will still render with numbers instead of the text but allow easier identification and linking.\ + This footnote also has been made with a different syntax using 4 spaces for new lines. +. +Here is a simple footnote\[^1\]. + +You can also use words, to fit your writing style more closely\[^note\]. + +\[^1\]: My reference. +\[^note\]: Named footnotes will still render with numbers instead of the text but allow easier identification and linking.\ +This footnote also has been made with a different syntax using 4 spaces for new lines. +. diff --git a/tests/fixtures.md b/tests/fixtures.md index 278e12c..7b1f2fe 100644 --- a/tests/fixtures.md +++ b/tests/fixtures.md @@ -159,7 +159,7 @@ List with explicit code block (that should keep indentation) . -Hanging List (https://github.com/executablebooks/mdformat/issues/371) +Hanging List (https://github.com/executablebooks/mdformat/issues/371 and https://github.com/KyleKing/mdformat-mkdocs/issues/4) . 1. Here indent width is three. @@ -184,6 +184,46 @@ Hanging List (https://github.com/executablebooks/mdformat/issues/371) Otherwise this next paragraph doesn't belong in the same list item. . + +Code block in semantic indent (https://github.com/KyleKing/mdformat-mkdocs/issues/6) +. +1. Item 1 + with a semantic line feed + + ```bash + echo "I get moved around by prettier/mdformat, originally I am 3 spaces deep" + ``` + +1. Item 2 +1. Item 3 +. +1. Item 1 + with a semantic line feed + + ```bash + echo "I get moved around by prettier/mdformat, originally I am 3 spaces deep" + ``` + +1. Item 2 + +1. Item 3 +. + + +Nested semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) +. +1. Line + semantic line 1 (3 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. +1. Line + semantic line 1 (3 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. + + Table . | Label | Rating | Comment | diff --git a/tests/test_align_semantic_breaks_in_numbered_lists.py b/tests/test_align_semantic_breaks_in_numbered_lists.py index 644176d..faf9f4f 100644 --- a/tests/test_align_semantic_breaks_in_numbered_lists.py +++ b/tests/test_align_semantic_breaks_in_numbered_lists.py @@ -1,37 +1,20 @@ -import mdformat - - -def test_align_semantic_breaks_in_numbered_lists(): - """For https://github.com/KyleKing/mdformat-mkdocs/issues/4.""" - input_text = """\ -1. Here indent width is - three. - - 2. Here indent width is - three. +from pathlib import Path -123. Here indent width is - five. It needs to be so, because - - Otherwise this next paragraph doesn't belong in the same list item. -""" - expected_output = """\ -1. Here indent width is - three. - - 1. Here indent width is - three. +from markdown_it.utils import read_fixture_file +import mdformat +import pytest -1. Here indent width is - five. It needs to be so, because +FIXTURE_PATH = Path(__file__).parent / "fixtures-semantic-indent.md" +fixtures = read_fixture_file(FIXTURE_PATH) - Otherwise this next paragraph doesn't belong in the same list item. -""" +@pytest.mark.parametrize( + "line,title,text,expected", fixtures, ids=[f[1] for f in fixtures] +) +def test_fixtures(line, title, text, expected): output = mdformat.text( - input_text, + text, options={"align_semantic_breaks_in_numbered_lists": True}, extensions={"mkdocs"}, ) - - assert output == expected_output + assert output.rstrip() == expected.rstrip() From b062647a1f5f8182d52b51d2acef1fea209839ba Mon Sep 17 00:00:00 2001 From: Kyle King Date: Mon, 17 Jul 2023 18:32:31 -0400 Subject: [PATCH 2/6] feat(#7): support 2-space on indents for nested bulleted lists --- mdformat_mkdocs/plugin.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mdformat_mkdocs/plugin.py b/mdformat_mkdocs/plugin.py index 197b58c..4e3b12c 100644 --- a/mdformat_mkdocs/plugin.py +++ b/mdformat_mkdocs/plugin.py @@ -10,7 +10,12 @@ """Use 4-spaces for mkdocs.""" _ALIGN_SEMANTIC_BREAKS_IN_NUMBERED_LISTS = False -"""use 3-space on subsequent lines in semantic lists.""" +"""user-specified flag for toggling semantic breaks. + +- 3-spaces on subsequent lines in semantic numbered lists +- and 2-spaces on subsequent bulleted items within a numbered list + +""" def add_cli_options(parser: argparse.ArgumentParser) -> None: @@ -47,6 +52,7 @@ def _normalize_list(text: str, node: RenderTreeNode, context: RenderContext) -> indent_counter = 0 indent_lookup: Dict[str, int] = {} is_numbered = False + use_semantic_breaks = _ALIGN_SEMANTIC_BREAKS_IN_NUMBERED_LISTS for line in text.split(eol): match = _RE_INDENT.match(line) assert match is not None # for pylint @@ -60,7 +66,7 @@ def _normalize_list(text: str, node: RenderTreeNode, context: RenderContext) -> this_indent = match["indent"] if this_indent: indent_diff = len(this_indent) - len(last_indent) - if indent_diff == 0: + if not indent_diff: ... elif indent_diff > 0: indent_counter += 1 @@ -71,10 +77,13 @@ def _normalize_list(text: str, node: RenderTreeNode, context: RenderContext) -> raise NotImplementedError(f"Error in indentation of: `{line}`") else: indent_counter = 0 + # Handle bulleted items within a numbered list + use_semantic_breaks = use_semantic_breaks and is_numbered last_indent = this_indent new_indent = indent * indent_counter - if _ALIGN_SEMANTIC_BREAKS_IN_NUMBERED_LISTS and not list_match and is_numbered: - new_indent = new_indent[:-1] + if use_semantic_breaks and not list_match: + removed_indents = -1 if is_numbered else -2 + new_indent = new_indent[:removed_indents] rendered += f"{new_indent}{new_line.strip()}{eol}" return rendered.rstrip() From abdb05dfb57645e22a2f3cee1c6a0c5e6ceaf1f7 Mon Sep 17 00:00:00 2001 From: Kyle King Date: Mon, 17 Jul 2023 18:41:28 -0400 Subject: [PATCH 3/6] test: add semantic indent test cases to pre-commit test --- ...align_semantic_breaks_in_numbered_lists.md | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md b/tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md index 9694561..dd539d6 100644 --- a/tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md +++ b/tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md @@ -1,4 +1,6 @@ -# Semantic Line Indents +# Testing `--align-semantic-breaks-in-numbered-lists` + +## Semantic Line Indents See discussion on: https://github.com/KyleKing/mdformat-mkdocs/issues/4 @@ -12,3 +14,27 @@ See discussion on: https://github.com/KyleKing/mdformat-mkdocs/issues/4 five (three). It needs to be so, because Otherwise this next paragraph doesn't belong in the same list item. + +## Code block in semantic indent + +From: https://github.com/KyleKing/mdformat-mkdocs/issues/6 + +1. Item 1 + with a semantic line feed + + ```bash + echo "I get moved around by prettier/mdformat, originally I am 3 spaces deep" + ``` + +1. Item 2 + +1. Item 3 + +## Nested semantic lines + +From: https://github.com/KyleKing/mdformat-mkdocs/issues/7 + +1. Line + semantic line 1 (3 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) From ffac669d0c32c9a5d051b43c0f745133015d7380 Mon Sep 17 00:00:00 2001 From: Kyle King Date: Tue, 18 Jul 2023 18:09:24 -0400 Subject: [PATCH 4/6] refactor: update test cases --- mkdocs-demo/docs/README.md | 22 ++++++++++++++++++++-- tests/fixtures-semantic-indent.md | 28 ++++++++++++++++++++++++++++ tests/fixtures.md | 28 ++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/mkdocs-demo/docs/README.md b/mkdocs-demo/docs/README.md index 23506e3..824a5b7 100644 --- a/mkdocs-demo/docs/README.md +++ b/mkdocs-demo/docs/README.md @@ -15,7 +15,7 @@ See discussion on: https://github.com/KyleKing/mdformat-mkdocs/issues/4 three. 1. Here indent width is - five (three). It needs to be so, because + five (three). The following indent needs to be four (but it is 3 with semantic change). Otherwise this next paragraph doesn't belong in the same list item. @@ -30,6 +30,24 @@ See discussion on: https://github.com/KyleKing/mdformat-mkdocs/issues/4 three (four). 1. Here indent width is - five (four). It needs to be so, because + five (four). The following indent needs to be four. Otherwise this next paragraph doesn't belong in the same list item. + +--- + +### With proposed change for bullets + +1. Line + semantic line 1 (3 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) + +--- + +### With proposed change for bullets nested in a numbered list + +- Line + semantic line 1 (2 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) diff --git a/tests/fixtures-semantic-indent.md b/tests/fixtures-semantic-indent.md index 513969a..475fadd 100644 --- a/tests/fixtures-semantic-indent.md +++ b/tests/fixtures-semantic-indent.md @@ -224,6 +224,34 @@ Nested semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) . +Bulleted semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) +. +- Line + semantic line 1 (2 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. +- Line + semantic line 1 (2 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. + + +Nested semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) +. +- Line + semantic line 1 (2 spaces deep) + 1. Bullet (4 spaces deep) + semantic line 2 (7 spaces deep) +. +- Line + semantic line 1 (2 spaces deep) + 1. Bullet (4 spaces deep) + semantic line 2 (7 spaces deep) +. + + Table . | Label | Rating | Comment | diff --git a/tests/fixtures.md b/tests/fixtures.md index 7b1f2fe..a554a67 100644 --- a/tests/fixtures.md +++ b/tests/fixtures.md @@ -224,6 +224,34 @@ Nested semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) . +Bulleted semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) +. +- Line + semantic line 1 (2 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. +- Line + semantic line 1 (2 spaces deep) + - Bullet (4 spaces deep) + semantic line 2 (6 spaces deep) +. + + +Nested semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) +. +- Line + semantic line 1 (2 spaces deep) + 1. Bullet (4 spaces deep) + semantic line 2 (7 spaces deep) +. +- Line + semantic line 1 (2 spaces deep) + 1. Bullet (4 spaces deep) + semantic line 2 (7 spaces deep) +. + + Table . | Label | Rating | Comment | From c8b478417cff2541744ea0516a3eb55a01cac1af Mon Sep 17 00:00:00 2001 From: Kyle King Date: Tue, 18 Jul 2023 18:20:21 -0400 Subject: [PATCH 5/6] feat: generalize semantic line breaks for bulleted lists as well --- .pre-commit-test.yaml | 4 ++-- README.md | 6 +++--- mdformat_mkdocs/plugin.py | 19 ++++++++----------- tests/fixtures-semantic-indent.md | 8 ++++---- tests/fixtures.md | 4 ++-- ...it-test-align_semantic_breaks_in_lists.md} | 2 +- ...=> test_align_semantic_breaks_in_lists.py} | 4 ++-- 7 files changed, 22 insertions(+), 25 deletions(-) rename tests/{pre-commit-test-align_semantic_breaks_in_numbered_lists.md => pre-commit-test-align_semantic_breaks_in_lists.md} (93%) rename tests/{test_align_semantic_breaks_in_numbered_lists.py => test_align_semantic_breaks_in_lists.py} (77%) diff --git a/.pre-commit-test.yaml b/.pre-commit-test.yaml index 37d5ec0..53f5b97 100644 --- a/.pre-commit-test.yaml +++ b/.pre-commit-test.yaml @@ -13,7 +13,7 @@ repos: - id: mdformat-with-semantic-arg name: mdformat-with-semantic-arg entry: mdformat - args: [--align-semantic-breaks-in-numbered-lists] - files: tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md + args: [--align-semantic-breaks-in-lists] + files: tests/pre-commit-test-align_semantic_breaks_in_lists.md types: [markdown] language: system diff --git a/README.md b/README.md index 8baf649..9724f20 100644 --- a/README.md +++ b/README.md @@ -51,19 +51,19 @@ pipx inject mdformat mdformat-mkdocs ## CLI Options -`mdformat-mkdocs` adds the CLI argument `--align-semantic-breaks-in-numbered-lists` to optionally align line breaks in numbered lists to 3-spaces. If not specified, the default of 4-indents is followed universally. +`mdformat-mkdocs` adds the CLI argument `--align-semantic-breaks-in-lists` to optionally align line breaks in numbered lists to 3-spaces. If not specified, the default of 4-indents is followed universally. ```txt # with: mdformat 1. Semantic line feed where the following line is three spaces deep -# vs. with: mdformat --align-semantic-breaks-in-numbered-lists +# vs. with: mdformat --align-semantic-breaks-in-lists 1. Semantic line feed where the following line is three spaces deep ``` -Note: the `align-semantic-breaks-in-numbered-lists` setting is not supported in the configuration file yet (https://github.com/executablebooks/mdformat/issues/378) +Note: the `align-semantic-breaks-in-lists` setting is not supported in the configuration file yet (https://github.com/executablebooks/mdformat/issues/378) ## Caveats diff --git a/mdformat_mkdocs/plugin.py b/mdformat_mkdocs/plugin.py index 4e3b12c..9e751ea 100644 --- a/mdformat_mkdocs/plugin.py +++ b/mdformat_mkdocs/plugin.py @@ -9,11 +9,11 @@ _MKDOCS_INDENT_COUNT = 4 """Use 4-spaces for mkdocs.""" -_ALIGN_SEMANTIC_BREAKS_IN_NUMBERED_LISTS = False +_ALIGN_SEMANTIC_BREAKS_IN_LISTS = False """user-specified flag for toggling semantic breaks. - 3-spaces on subsequent lines in semantic numbered lists -- and 2-spaces on subsequent bulleted items within a numbered list +- and 2-spaces on subsequent bulleted items """ @@ -21,17 +21,17 @@ def add_cli_options(parser: argparse.ArgumentParser) -> None: """Add options to the mdformat CLI, to be stored in `mdit.options["mdformat"]`.""" parser.add_argument( - "--align-semantic-breaks-in-numbered-lists", + "--align-semantic-breaks-in-lists", action="store_true", - help="If specified, align semantic indents in numbered lists to the text", + help="If specified, align semantic indents in numbered and bulleted lists to the text", ) def update_mdit(mdit: MarkdownIt) -> None: """No changes to markdown parsing are necessary.""" - global _ALIGN_SEMANTIC_BREAKS_IN_NUMBERED_LISTS - _ALIGN_SEMANTIC_BREAKS_IN_NUMBERED_LISTS = mdit.options["mdformat"].get( - "align_semantic_breaks_in_numbered_lists", False + global _ALIGN_SEMANTIC_BREAKS_IN_LISTS + _ALIGN_SEMANTIC_BREAKS_IN_LISTS = mdit.options["mdformat"].get( + "align_semantic_breaks_in_lists", False ) @@ -52,7 +52,6 @@ def _normalize_list(text: str, node: RenderTreeNode, context: RenderContext) -> indent_counter = 0 indent_lookup: Dict[str, int] = {} is_numbered = False - use_semantic_breaks = _ALIGN_SEMANTIC_BREAKS_IN_NUMBERED_LISTS for line in text.split(eol): match = _RE_INDENT.match(line) assert match is not None # for pylint @@ -77,11 +76,9 @@ def _normalize_list(text: str, node: RenderTreeNode, context: RenderContext) -> raise NotImplementedError(f"Error in indentation of: `{line}`") else: indent_counter = 0 - # Handle bulleted items within a numbered list - use_semantic_breaks = use_semantic_breaks and is_numbered last_indent = this_indent new_indent = indent * indent_counter - if use_semantic_breaks and not list_match: + if _ALIGN_SEMANTIC_BREAKS_IN_LISTS and not list_match: removed_indents = -1 if is_numbered else -2 new_indent = new_indent[:removed_indents] rendered += f"{new_indent}{new_line.strip()}{eol}" diff --git a/tests/fixtures-semantic-indent.md b/tests/fixtures-semantic-indent.md index 475fadd..22f963a 100644 --- a/tests/fixtures-semantic-indent.md +++ b/tests/fixtures-semantic-indent.md @@ -140,7 +140,7 @@ List with (what should be converted to a) code block . - item 1 - code block + code block . List with explicit code block (that should keep indentation) @@ -153,9 +153,9 @@ List with explicit code block (that should keep indentation) . - item 1 - ```txt - code block - ``` + ```txt + code block + ``` . diff --git a/tests/fixtures.md b/tests/fixtures.md index a554a67..2e392df 100644 --- a/tests/fixtures.md +++ b/tests/fixtures.md @@ -232,9 +232,9 @@ Bulleted semantic lines (https://github.com/KyleKing/mdformat-mkdocs/issues/7) semantic line 2 (6 spaces deep) . - Line - semantic line 1 (2 spaces deep) + semantic line 1 (2 spaces deep) - Bullet (4 spaces deep) - semantic line 2 (6 spaces deep) + semantic line 2 (6 spaces deep) . diff --git a/tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md b/tests/pre-commit-test-align_semantic_breaks_in_lists.md similarity index 93% rename from tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md rename to tests/pre-commit-test-align_semantic_breaks_in_lists.md index dd539d6..a1d8f77 100644 --- a/tests/pre-commit-test-align_semantic_breaks_in_numbered_lists.md +++ b/tests/pre-commit-test-align_semantic_breaks_in_lists.md @@ -1,4 +1,4 @@ -# Testing `--align-semantic-breaks-in-numbered-lists` +# Testing `--align-semantic-breaks-in-lists` ## Semantic Line Indents diff --git a/tests/test_align_semantic_breaks_in_numbered_lists.py b/tests/test_align_semantic_breaks_in_lists.py similarity index 77% rename from tests/test_align_semantic_breaks_in_numbered_lists.py rename to tests/test_align_semantic_breaks_in_lists.py index faf9f4f..7783a47 100644 --- a/tests/test_align_semantic_breaks_in_numbered_lists.py +++ b/tests/test_align_semantic_breaks_in_lists.py @@ -11,10 +11,10 @@ @pytest.mark.parametrize( "line,title,text,expected", fixtures, ids=[f[1] for f in fixtures] ) -def test_fixtures(line, title, text, expected): +def test_align_semantic_breaks_in_lists(line, title, text, expected): output = mdformat.text( text, - options={"align_semantic_breaks_in_numbered_lists": True}, + options={"align_semantic_breaks_in_lists": True}, extensions={"mkdocs"}, ) assert output.rstrip() == expected.rstrip() From 5f1ddd398176e543f525df6bc71691ef10e90fa7 Mon Sep 17 00:00:00 2001 From: Kyle King Date: Tue, 18 Jul 2023 18:25:38 -0400 Subject: [PATCH 6/6] release: bump mdformat-mkdocs version --- mdformat_mkdocs/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdformat_mkdocs/__init__.py b/mdformat_mkdocs/__init__.py index b509b21..f638e00 100644 --- a/mdformat_mkdocs/__init__.py +++ b/mdformat_mkdocs/__init__.py @@ -1,6 +1,6 @@ """An mdformat plugin for mkdocs.""" -__version__ = "1.0.2" +__version__ = "1.0.3" from .plugin import ( # noqa: F401 POSTPROCESSORS,