mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	HTML tags which are not converted to notecase formattings are stripped - that way notecase webapp doesn't save stuff not readable by notecase desktop. Also bugfix in parsing links
This commit is contained in:
		@@ -12,9 +12,9 @@ function html2notecase(contents, note) {
 | 
			
		||||
    note.images = [];
 | 
			
		||||
 | 
			
		||||
    while (index < contents.length) {
 | 
			
		||||
        if (contents[index] == '<') {
 | 
			
		||||
            let found = false;
 | 
			
		||||
 | 
			
		||||
        if (contents[index] == '<') {
 | 
			
		||||
            let curContent = contents.substr(index);
 | 
			
		||||
            let endOfTag = curContent.indexOf('>');
 | 
			
		||||
 | 
			
		||||
@@ -87,7 +87,7 @@ function html2notecase(contents, note) {
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            let match = /<a[^>]+?href="([^"]+?)"[^>]+?>([^<]+?)<\/a>/.exec(curContent);
 | 
			
		||||
            let match = /^<a[^>]+?href="([^"]+?)"[^>]+?>([^<]+?)<\/a>/.exec(curContent);
 | 
			
		||||
 | 
			
		||||
            if (match != null) {
 | 
			
		||||
                note.links.push({
 | 
			
		||||
@@ -114,9 +114,12 @@ function html2notecase(contents, note) {
 | 
			
		||||
            // if (match != null) {
 | 
			
		||||
 | 
			
		||||
            // }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            if (!found) {
 | 
			
		||||
                contents = contents.substr(0, index) + contents.substr(index + endOfTag + 1);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            index++;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user