Skip to content
Snippets Groups Projects
Commit d0869d26 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Adding support for changes in tables

parent 09ad910c
No related branches found
No related tags found
No related merge requests found
Pipeline #128 passed
...@@ -192,10 +192,29 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st ...@@ -192,10 +192,29 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
j = change.target_start - changed_clause.from_id # index gap j = change.target_start - changed_clause.from_id # index gap
for line in change: for line in change:
if (not (line.value.strip() == '') and (line.is_added)): if (not (line.value.strip() == '') and (line.is_added)):
if line.value.strip().startswith("|"): # It is a table
tableElements = line.value.strip().split("|")
modifiedElements:list[str] = []
for element in tableElements:
if not element.strip() == '':
modifiedElements.append("<span class=\"underline\">" + element.strip() + "</span>")
modifiedRow = "|" + "|".join(modifiedElements) + "|" + "\n"
clauseMDlines.insert(j,modifiedRow)
clauseMDlines.pop(j + 1)
else:
clauseMDlines.insert(j, "<span class=\"underline\">" + line.value + "</span>\n\n") clauseMDlines.insert(j, "<span class=\"underline\">" + line.value + "</span>\n\n")
#clauseMDlines.insert(j, "<mark>" + line.value.strip("\n") + "</mark>\n\n") #clauseMDlines.insert(j, "<mark>" + line.value.strip("\n") + "</mark>\n\n")
clauseMDlines.pop(j+1) clauseMDlines.pop(j+1)
elif line.is_removed: elif line.is_removed:
if line.value.strip().startswith("|"): # It is a table
tableElements = line.value.strip().split("|")
modifiedElements: list[str] = []
for element in tableElements:
if not element.strip() == '':
modifiedElements.append("~~" + element.strip() + "~~")
modifiedRow = "|" + "|".join(modifiedElements) + "|" + "\n"
clauseMDlines.insert(j, modifiedRow)
else:
clauseMDlines.insert(j, "~~" + line.value.strip() + "~~") clauseMDlines.insert(j, "~~" + line.value.strip() + "~~")
j = j + 1 j = j + 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment