Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No html tags anymore? #1283

Closed
RaZorHack opened this issue Sep 6, 2019 · 9 comments

Comments

@RaZorHack
Copy link

commented Sep 6, 2019

Hallo,

For the design of my notes I also use html-tags
<br> | <center> | <span> - etc.

Until recently, everything worked fine.
However, these have no effect in the last two versions of QOwnNotes in the preview.

Is this a bug or a feature? :-)

Best regards


Info:
OS: Windows 10 1903 x64
QOwnNotes 19.9.4 | used in Portable Mode

@pbek

This comment has been minimized.

Copy link
Owner

commented Sep 6, 2019

Thank you for reporting, sounds like a side effect from all the efforts I put into #266. I'll take a look into it!

@pbek pbek added the bug label Sep 6, 2019

@pbek

This comment has been minimized.

Copy link
Owner

commented Sep 6, 2019

It seems

// Try to replace links like <my-note.md> or <file.pdf> with proper file links
// We need to do that in the markdown because Hoedown would not create a link tag
// This is a "has not '\w+:\/\/' in it" regular expression
// see: http://stackoverflow.com/questions/406230/regular-expression-to-match-line-that-doesnt-contain-a-word
// TODO: maybe we could do that per QTextBlock to check if it's done in comment block?
// Important: The `\n` is needed to not crash under Windows if there is just
// an opening `<` and a lot of other text after it
i = QRegularExpression("<(((?!\\w+:\\/\\/)[^<>\n])+)>").globalMatch(str);
while (i.hasNext()) {
QRegularExpressionMatch match = i.next();
QString fileLink = match.captured(1);
QString url = Note::getFileURLFromFileName(fileLink);
str.replace(match.captured(0),
"[" + fileLink + "](" + url + ")");
}
needs a check if the linked file exists.

@pbek

This comment has been minimized.

Copy link
Owner

commented Sep 6, 2019

...or a check if . exists in the filename

@RaZorHack

This comment has been minimized.

Copy link
Author

commented Sep 6, 2019

Text:

text1

Preview:

text

pbek added a commit that referenced this issue Sep 7, 2019
@pbek

This comment has been minimized.

Copy link
Owner

commented Sep 7, 2019

19.9.5

  • the preview of html tags now works again
    • html tags are now also not highlighted as link

@pbek pbek added this to the 19.9.5 milestone Sep 7, 2019

pbek added a commit that referenced this issue Sep 7, 2019
@pbek

This comment has been minimized.

Copy link
Owner

commented Sep 7, 2019

There now is a new release, could you please test it and report if it works for you?

@RaZorHack

This comment has been minimized.

Copy link
Author

commented Sep 7, 2019

The update function of 19.9.4 will not find a new version.
On the homepage is: currently 19.9.5 - on the download page
https://www.qownnotes.org/installation#Windows
but only the 19.9.4 is available.
Also at GitHub
https://github.com/pbek/QOwnNotes/releases
I can not find a download of 19.9.5 for Windows.

@RaZorHack

This comment has been minimized.

Copy link
Author

commented Sep 7, 2019

Alright ... - now the download is available :-)
I have updated to 19.9.5 - everything works fine again!

thank you very much...
You are doing a great job...

@pbek

This comment has been minimized.

Copy link
Owner

commented Sep 7, 2019

Great, thank you for reporting and testing! 😄

@pbek pbek closed this Sep 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.