Skip to content

Commit 6ed9a36

Browse files
committed
Reverse Critic deprecation
Instead, we'll just freeze further enhancements to the visualizer
1 parent 4c8a90f commit 6ed9a36

File tree

4 files changed

+5
-23
lines changed

4 files changed

+5
-23
lines changed

docs/src/markdown/about/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ icon: lucide/scroll-text
66
## 10.19
77

88
- **NEW**: Emoji: Update Twemoji to use Unicode 16.
9+
- **NEW**: Critic: Roll back `view` mode deprecation as some still like to use it, though further enhancements to this
10+
mode are not planned.
911

1012
## 10.18
1113

docs/src/markdown/extensions/critic.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ represent edits to a Markdown document. This extension runs before all other ex
1313
Critic allows you to automatically accept edits or reject the edits and render the output accordingly. It also allows
1414
for visually displaying the changes in HTML output ([mileage may vary](#limitations-with-previewing-critic-markup)).
1515

16-
/// warning | Previews Deprecated
17-
The preview mode has been deprecated, and the default `mode` will be set to `accept` in the future. If you rely on
18-
Critic, is advised to explicitly set `mode` to either `accept` or `reject` to be protected against any issues related
19-
to this change in default and removal of the `view` mode in the future.
20-
21-
The `view` mode is being removed simply because support was never that great, and in order to get the quality expected,
22-
the feature would have to be implemented into the core of Python Markdown, something that is impossible for us to do.
23-
///
24-
2516
The Critic extension can be included in Python Markdown by using the following:
2617

2718
```py3
@@ -225,8 +216,8 @@ here:
225216
The Critic extension does its best by employing a preprocessor to inject the critic tags before all other parsing and a
226217
post-processor to clean up some of the weird side effects of the injection (only selected odd cases as others are more
227218
difficult to fix). It injects some classes into the edit region's HTML output which allows for CSS styling. There is
228-
probably a lot more post-processing that could be done to fix more issues, but whether this extension will be going
229-
further down that road has not yet been decided.
219+
probably a lot more post-processing that could be done to fix more issues, but there are no plans to enhance the view
220+
mode any further than it already has been.
230221

231222
## CSS
232223

pymdownx/critic.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from markdown.preprocessors import Preprocessor
2828
from markdown.postprocessors import Postprocessor
2929
from markdown.util import STX, ETX
30-
from .util import warn_deprecated
3130
import re
3231

3332
SOH = '\u0001' # start
@@ -297,7 +296,7 @@ def __init__(self, *args, **kwargs):
297296
self.config = {
298297
'mode': [
299298
'view',
300-
"Critic mode to run in: 'view' (deprecated), 'accept' (future default), or 'reject' - Default: view "
299+
"Critic mode to run in: 'view', 'accept', or 'reject' - Default: view "
301300
],
302301
'raw_view': [False, "Raw view keeps the output as the raw markup for view mode - Default False"]
303302
}
@@ -312,12 +311,6 @@ def extendMarkdown(self, md):
312311
post = CriticsPostprocessor(self.critic_stash)
313312
critic = CriticViewPreprocessor(self.critic_stash)
314313
critic.config = self.getConfigs()
315-
if critic.config['mode'] == 'view':
316-
warn_deprecated(
317-
"pymdownx.critic has deprecated the 'view' mode and will default the option to 'accept' "
318-
"in the future. It is advised to set the 'mode' option explicitly to either 'accept' or "
319-
"'reject' to avoid issues when this change takes place."
320-
)
321314
md.preprocessors.register(critic, "critic", 31.1)
322315
md.postprocessors.register(post, "critic-post", 25)
323316
md.registerExtensions(["pymdownx._bypassnorm"], {})

tests/test_extensions/test_critic.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Test caret."""
22
from .. import util
3-
import pytest
4-
53

64
class TestCriticViewMode(util.MdCase):
75
"""Test view mode."""
@@ -15,7 +13,6 @@ class TestCriticViewMode(util.MdCase):
1513
}
1614
}
1715

18-
@pytest.mark.filterwarnings("ignore")
1916
def test_view(self):
2017
"""Test view mode."""
2118

@@ -245,7 +242,6 @@ class TestCriticEscapeAll(util.MdCase):
245242
}
246243
}
247244

248-
@pytest.mark.filterwarnings("ignore")
249245
def test_escape(self):
250246
"""Test with escapes."""
251247

0 commit comments

Comments
 (0)