I am currently developing a bot that can repair unclosed format tags. There are different ways to deal with different situations. But I don’t know if these repair are reasonable, so I’m here to ask everyone’s opinion.
Scenario 1:
<code>test<code>
Repair 1:
Close the second tag.
Repair result 1:
<code>test</code>
Scenario 1-1:
<code>test<code>foo<code>
Repair 1-1:
Remove the second tag – <code>
and close the three tag.
Repair result 1-1:
<code>testfoo</code>
Scenario 2:
<code>test<code></code>
Or <code><code>test</code>
Repair 2:
Remove the second tag – <code>
.
Repair result 2:
<code>test</code>
Scenario 2-1:
<code>test<code>foo<code>hum</code>
Repair 2-1:
Close the second tag
Repair result 2-1:
<code>test</code>foo<code>hum</code>
Scenario 3:
<code>test<code>foo</code>
Repair 3:
Remove the second tag – <code>
.
Repair result 3:
<code>testfoo</code>