Objective: To test how well unwanted html tags are filtered out when editors are doing simple copy-and-paste to the LTI tool card html fields.
Procedure:
- A sample html file is created to simulate random website paragraphs to which text filter may need to be applied.
See
sample.html
for source codes between<body></body>
. - Texts are copied from the webpage view (i.e., after the html file is opened in a browser), and pasted directly into an html field of a CAE card during local test.
- After the changes to the card is saved, the edit view is re-entered to check what the source codes have become.
- Record the altered source codes for comparison.
See
sample_altered.html
for new source codes between<body></body>
. I added a few empty lines in between for clarity.
Conclusion:
- The current HTML text filter settings is able to remove:
text alignments, text fonts, text colors, background colors
. - The current HTML text filter settings is able to keep:
bold text, italic text, ordered or unordered list, strikethrough, underline
. - However, some
that are not in the original html texts are somehow created. Their effect on the card display is to be seen, as on this develop branch the bug of no line break between paragraphs has not been fixed.
After a rebase with main and removal of span
tag from invalid_elements
, how sample.html
content gets altered is shown in sample_altered-with-span.html
.
Conclusion:
Compared to sample_altered.html
, the major difference are:
- the disappearance of
, although it's unclear whether this is the result of the rebase or the introduction ofspan
. - effects of
span
-related styles (e.g.,<span style="text-align: center;">
) no longer get replaced by
.