Skip to content

Commit 7110adf

Browse files
authored
Don't check for "notranslate" CSS class (#75)
1 parent b86edd2 commit 7110adf

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

docs/src/about.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ a bug, which you can report on `GitHub
7272
If third-party code blocks are in use, matching may fail because of
7373
inconsistent or unrecognised CSS classes. The class related to the block lexer
7474
name is automatically added to the list of CSS classes that are searched when
75-
matching code examples as ``highlight-{lexer} notranslate``.
75+
matching code examples as ``highlight-{lexer}``.
7676
If the class has another value, :confval:`codeautolink_search_css_classes`
7777
can be used to extend the search. To find out which classes should be added,
7878
build your documentation, locate the code example and use the class of the
7979
outermost ``div`` tag. For example:
8080

8181
.. code:: python
8282
83-
codeautolink_search_css_classes = ["highlight-default notranslate"]
83+
codeautolink_search_css_classes = ["highlight-default"]
8484
8585
Secondly, matching can fail on a specific line or range of lines.
8686
This is often a bug, but the known expected failure cases are presented here:

docs/src/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ sphinx-codeautolink adheres to
1111
Unreleased
1212
----------
1313
- Correctly test for optional types in annotations (:issue:`72`)
14+
- Don't check for ``notranslate`` CSS class, allow additional classes (:issue:`75`)
1415

1516
0.7.0 (2021-11-28)
1617
------------------

src/sphinx_codeautolink/extension/block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def link_html(
231231
soup = BeautifulSoup(text, 'html.parser')
232232

233233
block_types = {'python', 'pycon'} | set(custom_blocks.keys())
234-
classes = [f'highlight-{t} notranslate' for t in block_types] + ['doctest']
234+
classes = [f'highlight-{t}' for t in block_types] + ['doctest']
235235
classes += search_css_classes
236236

237237
blocks = []

0 commit comments

Comments
 (0)