You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present the alt text for an image is also put into the title, where the spec[1] puts the title as an optional string after the URL.
I think you can fix it as follows:
(a) change the links pattern at line 24 to links: /!?\[([^\]<>]+)\]\(([^ \)<>]+)( "([^\(\)\"]+)")?\)/g,
(that is, to be enable extraction of the title text between the quotes), and
(b) replace the img element construction at line 190 with str = str.replace(stra[0], '<img src="' + stra[2] + '" alt="' + stra[1] + '"' + (stra[4] ? '" title="' + stra[4] + '" ' : '') + '/>');
recognising that title is optional.
At present the alt text for an image is also put into the title, where the spec[1] puts the title as an optional string after the URL.
I think you can fix it as follows:
(a) change the links pattern at line 24 to
links: /!?\[([^\]<>]+)\]\(([^ \)<>]+)( "([^\(\)\"]+)")?\)/g,
(that is, to be enable extraction of the title text between the quotes), and
(b) replace the img element construction at line 190 with
str = str.replace(stra[0], '<img src="' + stra[2] + '" alt="' + stra[1] + '"' + (stra[4] ? '" title="' + stra[4] + '" ' : '') + '/>');
recognising that title is optional.
Thanks for this useful library.
[1] https://daringfireball.net/projects/markdown/syntax#img
The text was updated successfully, but these errors were encountered: