-
Notifications
You must be signed in to change notification settings - Fork 526
Open
Description
If I have this HTML:
<img src="example.png" alt="Alt text
With
Multiple newlines." >
It is transformed into:
<p><img src="example.png" alt="Alt text</p>
<p>With</p>
<p>Multiple newlines." ></p>
Changing this line:
php-markdown/Michelf/MarkdownExtra.php
Line 342 in 5161316
protected string $clean_tags_re = 'script|style|math|svg'; |
to
protected string $clean_tags_re = 'script|style|math|svg|img';
Fixes the issue.
I can't think of anything within an <img>
element which should be altered by Markdown. Alt text can't contain HTML elements, src shouldn't be altered, it's a self-closing element so won't have any contents.
Are there any downsides to adding img to this regex?
Metadata
Metadata
Assignees
Labels
No labels