PLT-6799 Removed <wbr> tags from markdown links (#6766)

* PLT-6799 Removed <wbr> tags from markdown links

* Fixed unit tests
Этот коммит содержится в:
Harrison Healey
2017-06-28 01:47:51 -04:00
коммит произвёл Saturnino Abril
родитель 99fc4b0988
Коммит 4484c82b1b
3 изменённых файлов: 4 добавлений и 16 удалений

Просмотреть файл

@@ -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 />' : '');
});
}