Escaping name and desc properties before converting to HMTL
This PR addresses some undesirable things that can happen with the legal system RDL format string but would result in undesirable problems in HTML. See the following issue tickets:
- systemrdl/peakrdl-html#53
- krcb197/peakrdl-python#169
There are two parts to this:
- The systemRDL string is escaped with the builtin python
html.escapefunction before conversion - The systemrdl
[quote]and[/quote]constructs are converted to HTML as"rather than"
coverage: 92.306% (+0.004%) from 92.302% when pulling 4b4c74edac14883b8a0c449a5790d9fbe7c65d11 on krcb197:escaping_html into 3deb51bdb2dde59bd4b06a6e87c30064f43cd984 on SystemRDL:main.
See my comments in parent issue https://github.com/SystemRDL/PeakRDL-html/issues/53
I cannot justify merging this change as-is. Perhaps just the 2nd part for RDLFormatCode [quote] and [/quote] tags.
@amykyta3
Thank you for the review comments. I understand that escaping the HTML characters can not be the default behaviour.
I still think it may be helpful in some cases to clean the desc and name properties, I have resubmitted the PR with this as an optional behaviour (off by default). I discovered that the & is escaped by default when the markdown processor is applied.
Does that address your concerns?