Skip to content

Commit

Permalink
Escape html vid (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishig25 authored Dec 26, 2022
1 parent f4adaec commit cc2be79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc_builder/convert_md_to_mdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def convert_special_chars(text):
text = _re_lcub_svelte.sub(lambda match: match[0].replace("{", "{"), text)
# We don't want to replace those by the HTML code, so we temporarily set them at LTHTML
text = re.sub(
r"<(img|br|hr|Youtube|Question|DocNotebookDropdown|CourseFloatingBanner|FrameworkSwitch|audio|PipelineIcon|PipelineTag)",
r"<(img|video|br|hr|Youtube|Question|DocNotebookDropdown|CourseFloatingBanner|FrameworkSwitch|audio|PipelineIcon|PipelineTag)",
r"LTHTML\1",
text,
) # html void elements with no closing counterpart
Expand Down
3 changes: 3 additions & 0 deletions tests/test_convert_md_to_mdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def test_convert_special_chars(self):
img_code = '<img src="someSrc">'
self.assertEqual(convert_special_chars(img_code), img_code)

video_code = '<video src="someSrc">'
self.assertEqual(convert_special_chars(video_code), video_code)

comment = "<!-- comment -->"
self.assertEqual(convert_special_chars(comment), comment)

Expand Down

0 comments on commit cc2be79

Please sign in to comment.