[Backport] regex find links with spaces and format them
parent
a820a3a934
commit
ea4a99d393
|
@ -79,6 +79,13 @@ class WysiwygService
|
|||
|
||||
return '[' + title + '](' + link + ')'
|
||||
|
||||
|
||||
linkTitleWithSpaces: (text) ->
|
||||
link = /\[[^\]]*\]\(([^\)]*)\)/g # [Title-with-spaces](Title with spaces)
|
||||
|
||||
return text.replace link, (match, p1, offset, str) ->
|
||||
return match.replace /\(.*\)/, '(' + taiga.slugify(p1) + ')'
|
||||
|
||||
replaceUrls: (html) ->
|
||||
el = document.createElement( 'html' )
|
||||
el.innerHTML = html
|
||||
|
@ -213,6 +220,7 @@ class WysiwygService
|
|||
}
|
||||
|
||||
text = @.replaceEmojiNameByImgs(text)
|
||||
text = @.linkTitleWithSpaces(text)
|
||||
text = @.pipeLinks(text)
|
||||
|
||||
md = window.markdownit({
|
||||
|
|
Loading…
Reference in New Issue