mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-24 08:12:24 +02:00
parent
fed623e3a4
commit
8324af5682
@ -0,0 +1,6 @@
|
||||
<ul>
|
||||
<li><a href="http://example.com/a_test">http://example.com/a_test</a></li>
|
||||
<li><a href="http://example.com/a_test/___">http://example.com/a_test/___</a></li>
|
||||
<li>Another <i>test</i>: <a href="http://example.com/a_test/*">http://example.com/a_test/*</a></li>
|
||||
<li>And another <b>test</b>: <a href="http://example.com/_test_">Test</a></li>
|
||||
</ul>
|
@ -0,0 +1,4 @@
|
||||
- http://example.com/a_test
|
||||
- http://example.com/a_test/___
|
||||
- Another *test*: http://example.com/a_test/*
|
||||
- And another **test**: [Test](http://example.com/_test_)
|
@ -313,6 +313,12 @@ rules.inlineLink = {
|
||||
)
|
||||
},
|
||||
|
||||
escapeContent: function (node, _options) {
|
||||
// Disable escaping content (including '_'s) when the link has the same URL and href.
|
||||
// This prevents links from being broken by added escapes.
|
||||
return node.getAttribute('href') !== node.textContent;
|
||||
},
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
var href = filterLinkHref(node.getAttribute('href'))
|
||||
|
||||
|
@ -216,7 +216,7 @@ function postProcess (output) {
|
||||
|
||||
function replacementForNode (node) {
|
||||
var rule = this.rules.forNode(node)
|
||||
var content = process.call(this, node, rule.escapeContent ? rule.escapeContent() : 'auto')
|
||||
var content = process.call(this, node, rule.escapeContent ? rule.escapeContent(node) : 'auto')
|
||||
var whitespace = node.flankingWhitespace
|
||||
if (whitespace.leading || whitespace.trailing) content = content.trim()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user