remove # escaping to stop breaking html entities
This commit is contained in:
parent
7bb0e32b9a
commit
105805fb69
1 changed files with 0 additions and 1 deletions
|
@ -32,7 +32,6 @@ function parseHtmlEntities(str) {
|
||||||
|
|
||||||
function htmlToMarkdown(str, images = true, embed = true) {
|
function htmlToMarkdown(str, images = true, embed = true) {
|
||||||
str = str.replaceAll("\\", "\\\\");
|
str = str.replaceAll("\\", "\\\\");
|
||||||
str = str.replaceAll("#", "\\#");
|
|
||||||
str = str.replace(/<style(\s+[^>]+)?>(.|\n)*?<\/style>/gi, "");
|
str = str.replace(/<style(\s+[^>]+)?>(.|\n)*?<\/style>/gi, "");
|
||||||
str = str.replace(/<a (\s+[^>]+)?href="([^"]+?)"(\s+[^>]+)?>(.+?)<\/a>/gi, (_, __, url, ___, text) => {
|
str = str.replace(/<a (\s+[^>]+)?href="([^"]+?)"(\s+[^>]+)?>(.+?)<\/a>/gi, (_, __, url, ___, text) => {
|
||||||
url = url.replace(/^\/\//, "https://").replace("\\#", "#");
|
url = url.replace(/^\/\//, "https://").replace("\\#", "#");
|
||||||
|
|
Loading…
Reference in a new issue