thephpleague / html-to-markdown

Convert HTML to Markdown with PHP
MIT License
1.77k stars 205 forks source link

Sanitization function for ParagraphConverter #105

Closed andreskrey closed 7 years ago

andreskrey commented 7 years ago

This fixes issue #76 and sets the path for future sanitization tasks.

On the ParagraphConverter I added a new function that will handle all the sanitization needed. Right now it has two different sanitizators, one for headerlike characters and one for blockquotelike characters.

Since it scans the paragraph contents line by line, new sanitizators can be added in the future.

I also added new tests.

Please check it out and tell me what you think.

colinodell commented 7 years ago

This looks good to me, thanks for fixing that!