Open sabre23t opened 2 years ago
I believe this can be fixed by making one of the matches less greedy. Specifically, changing this pattern, at line 1016 in master, from
h = h.replace(new RegExp("<"+tag+"((?!>).+)(/)?>","gi"),"<"+tag+"$1"+"/>");
to
h = h.replace(new RegExp("<"+tag+"((?!>).+?)(/)?>","gi"),"<"+tag+"$1"+"/>");
I've added a ?
. Attached is a quick harness to exercise the fix.
If you have the following HTML in a Concord Example 1 v0.5.3 headline:
<img src="img_girl.jpg" width="500"><img src="img_girl2.jpg" width="500">
When you go into Concord render mode the second IMG tag will have all attributes deleted.
<img src="img_girl.jpg" width="500" ><img="">
Further notes
Outliner > Toggle Render Mode
menu command doesn't work. Console log shows error messagetoggleRenderMode is not defined
. Keyboard commandCtrl-`
also didn't work. However, reloading Example 1 webpage, does reload its outline in render mode. Inspecting DOM elements shows the current transfomed content of that headline (with all attributes deleted for the second IMG tag).new RegExp("<"+tag+"((?!>).+)(/)?>","gi")
. It appears that is now at Line 1016 of concord.js.