1
0
forked from docs/doc-exports

Compare commits

...

4 Commits

2 changed files with 30 additions and 1 deletions

View File

@ -403,7 +403,8 @@ class OTCDocConvertor:
# MRS UMN contain: /:*?"<>|\\;&,'`!{}[]$%+
r"\s([^a-zA-Z0-9\s]{8,})",
# MRS operation guide contain: /*+ MAPJOIN(join_table) \*/
r"\s(/\*.*\*/)",
# RDS UMN contain: /*FORCE_MASTER*/
r"(/\*.{5,}\*/)",
# BMS API contain sequence in a dedicated paragraph
r"^([^a-zA-Z0-9\s]{10,})$",
# OBS special chars - "\$" "\\" etc

View File

@ -191,3 +191,31 @@ class TestConvertor(TestCase):
str(res.find('p')),
expected.strip(),
)
def test_streamline_html_escape_14(self):
test_data= """
<li id="mrs_01_0979__en-us_topic_0000001173470738_en-us_topic_0116526932_li53294272">Use /*+ MAPJOIN(join_table) */.</li>
""" # noqa
expected = """
<li>Use <code>/*+ MAPJOIN(join_table) */</code>.</li>
""" # noqa
soup = bs4.BeautifulSoup(test_data, 'lxml')
res = self.convertor.streamline_html(soup, "dummy")
self.assertEqual(
str(res.find('li')),
expected.strip(),
)
def test_streamline_html_escape_15(self):
test_data= """
<p id="rds_11_0020__en-us_topic_0200110324_p133410225015">/*FORCE_MASTER*/: A SQL statement is routed to the primary DB instance.</p>
""" # noqa
expected = """
<p id="rds_11_0020__en-us_topic_0200110324_p133410225015"><code>/*FORCE_MASTER*/</code>: A SQL statement is routed to the primary DB instance.</p>
""" # noqa
soup = bs4.BeautifulSoup(test_data, 'lxml')
res = self.convertor.streamline_html(soup, "dummy")
self.assertEqual(
str(res.find('p')),
expected.strip(),
)