Closed BoboTiG closed 5 years ago
Have you checked if it work with HTML code paste such as http://0bin.net/paste/QOFtPlUYSmdpTLmL#F1Q14RcqqzlshPx6xMm+mSNLq80bdRSHWFwsWysrdt6 ? I haven't tried your code yet, but I feel like converting the URL inside would break it.
It does not work with your example. I am working on that.
This should be good. The solution works as:
||a||
instead of <a
and ||/||a>
for </a>
)<
to <
)||a||
to <a
and ||/||a>
to </a>
)It is not beautiful but it works.
Any news on this PR?
Does the URL parser avoid URL such as file://
, if you know what I mean ?
A first try to make URL clickable automatically. What do you think? The second commit will prevent XSS, in theory.
For better security, we could add a function callback to
content.replace
to check if there is at least one replacement. If so, then we use$('#paste-content').html()
else$('#paste-content').text()
.