Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Individual Element Styling is Removed #105

Open
mprythero opened this issue Jun 21, 2021 · 1 comment
Open

Individual Element Styling is Removed #105

mprythero opened this issue Jun 21, 2021 · 1 comment

Comments

@mprythero
Copy link

I have an individual problem with the HTMLDiff and it removing styling of lists.

Say I have the following text to compare:

<ol style="list-style-type:upper-latin;">
<li>No public officer or employee having the power or duty to perform an official act related to a contract or transaction which is the subject of an official act or action of the Town shall:
<ol>
<li>Have or thereafter acquire an interest in such contract or transaction unless said contract or transaction resulted from the proper bid process for the Town;&nbsp;</li>
</ol>
</li>
</ol>

Everytime it compares the above text, it strips the style of the ol, rending the lists basically useless. Is there a way I could keep the styling? I need it to maintain the lists in our manuals but I would like to maintain the lists as they are originally, not with the list style stripped out.

Thanks!

@SavageTiger
Copy link
Contributor

SavageTiger commented Jun 28, 2021

Hi, this is likely done by purifier, you can disable purifier by doing ->setPurifierEnabled(false) on the htmldiff config.

However I do suggest you purify the html that you diff for the best most accurate results (by using htmlpurifier yourself, and altering the config to specify what attributes you really do not want to get stripped before sending it to the differ). Unless you are sure the HTML is as clean and correct as can be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants