File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
src/antsibull_docs_parser Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ bugfixes :
2
+ - " Make sure to also escape pipes (``\\ |``) in reStructured Text (https://github.com/ansible-community/antsibull-docs-parser/pull/65)."
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ def rst_escape(
32
32
value = value .replace ("_" , "\\ _" )
33
33
value = value .replace ("*" , "\\ *" )
34
34
value = value .replace ("`" , "\\ `" )
35
+ value = value .replace ("|" , "\\ |" )
35
36
36
37
# RST does not like it when the inside of `...` starts or ends with a whitespace
37
38
# (here, all kind of whitespaces count, not just spaces...)
Original file line number Diff line number Diff line change @@ -1621,3 +1621,17 @@ test_vectors:
1621
1621
-------------
1622
1622
x [[ERROR while parsing: While parsing "M(föø \t b\nz \r m)" at index 125: Module name "föø b z m" is not a FQCN]]
1623
1623
` '` '* *` '
1624
+ pipe_symbol :
1625
+ source : Use C(0)|C(1).
1626
+ html : |-
1627
+ <p>Use <code class='docutils literal notranslate'>0</code>|<code class='docutils literal notranslate'>1</code>.</p>
1628
+ html_plain : |-
1629
+ <p>Use <code>0</code>|<code>1</code>.</p>
1630
+ md : |-
1631
+ Use <code>0</code>\|<code>1</code>\.
1632
+ rst : |-
1633
+ Use :literal:`0`\ \|\ :literal:`1`.
1634
+ rst_plain : |-
1635
+ Use :literal:`0`\ \|\ :literal:`1`.
1636
+ ansible_doc_text : |-
1637
+ Use `0'|`1'.
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def test_rst_escape():
17
17
assert rst_escape ("" ) == ""
18
18
assert rst_escape (" foo " ) == " foo "
19
19
assert rst_escape (" foo " , True ) == "\\ foo \\ "
20
- assert rst_escape ("\\ <_>`*<_>*`\\ " ) == "\\ \\ \\ <\\ _\\ >\\ `\\ *\\ <\\ _\\ >\\ *\\ `\\ \\ "
20
+ assert rst_escape ("\\ <_>`*<_>*`\\ | " ) == "\\ \\ \\ <\\ _\\ >\\ `\\ *\\ <\\ _\\ >\\ *\\ `\\ \\ \\ | "
21
21
22
22
23
23
def test_postprocess_rst_paragraph ():
You can’t perform that action at this time.
0 commit comments