PLT-6799 Removed <wbr> tags from markdown links (#6766)
* PLT-6799 Removed <wbr> tags from markdown links * Fixed unit tests
Этот коммит содержится в:
коммит произвёл
Saturnino Abril
родитель
99fc4b0988
Коммит
4484c82b1b
@@ -53,11 +53,6 @@ export function formatText(text, inputOptions) {
|
||||
output = replaceNewlines(output);
|
||||
}
|
||||
|
||||
// Add <wbr /> tags to recommend line breaking on slashes within URLs
|
||||
if (!options.singleline) {
|
||||
output = insertLongLinkWbr(output);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -477,10 +472,3 @@ export function replaceTokens(text, tokens) {
|
||||
function replaceNewlines(text) {
|
||||
return text.replace(/\n/g, ' ');
|
||||
}
|
||||
|
||||
//replace all "/" inside <a> tags to "/<wbr />"
|
||||
function insertLongLinkWbr(test) {
|
||||
return test.replace(/\//g, (match, position, string) => {
|
||||
return match + ((/a[^>]*>[^<]*$/).test(string.substr(0, position)) ? '<wbr />' : '');
|
||||
});
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user