Skip to content

Commit 57f59bc

Browse files
authored
Fix missing HTML escape (#106)
* Fix missing HTML escape. * Shorten line length.
1 parent af0d964 commit 57f59bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/antsibull_docs/jinja2/htmlify.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def handle(self, parameters: t.List[str], context: t.Any) -> str:
209209
link_end = ''
210210
return (
211211
f'<code class="{cls} literal notranslate">'
212-
f'{strong_start}{link_start}{text}{link_end}{strong_end}</code>'
212+
f'{strong_start}{link_start}{html_escape(text)}{link_end}{strong_end}</code>'
213213
)
214214

215215

@@ -267,7 +267,10 @@ def handle(self, parameters: t.List[str], context: t.Any) -> str:
267267
else:
268268
link_start = ''
269269
link_end = ''
270-
return f'<code class="{cls} literal notranslate">{link_start}{text}{link_end}</code>'
270+
return (
271+
f'<code class="{cls} literal notranslate">{link_start}'
272+
f'{html_escape(text)}{link_end}</code>'
273+
)
271274

272275

273276
class _HorizontalLine(Command):

0 commit comments

Comments
 (0)