adding rds fix for /* ... */ match which should also conver mrs previous

Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
This commit is contained in:
Hasko, Vladimir 2023-03-29 11:22:35 +00:00 committed by zuul
parent f15f2de664
commit 70c0715827
2 changed files with 30 additions and 1 deletions

View File

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

View File

@ -191,3 +191,31 @@ class TestConvertor(TestCase):
str(res.find('p')), str(res.find('p')),
expected.strip(), 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(),
)