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

Backticks are not filtered in navigation list #2791

Closed
patvdv opened this issue Jun 10, 2023 · 14 comments
Closed

Backticks are not filtered in navigation list #2791

patvdv opened this issue Jun 10, 2023 · 14 comments
Labels
Milestone

Comments

@patvdv
Copy link
Sponsor

patvdv commented Jun 10, 2023

Expected behaviour

When using backticks in any markdown header line, the resulting preview of the navigation list does not filter the backticks. Other markup like italic or bold IS filtered out correctly in preview mode

Actual behaviour

  • Backticks should be shown in edit mode: OK
  • Backticks should be filtered in preview mode: NOK

Steps to reproduce

See screenshots:
edit mode:
edit-mode

preview mode:
preview-mode

@pbek
Copy link
Owner

pbek commented Jun 11, 2023

I think I still don't get what we are talking about.

image

The Navigation panel does not generate HTML out of Markdown... Or are you talking about the preview?

Can you please describe what you expected, what the actual behavior was, and step by step what you did?

@patvdv
Copy link
Sponsor Author

patvdv commented Jun 13, 2023

Hi,

I made a mistake in assuming bold and italic were being stripped out. My eyes were deceiving me. The behaviour is indeed consistent for all markup. My apologies for that. However: I don't see the logic in displaying markup as raw markdown in the navigation panel. It is quite distracting, IMHO a navigation list of plain text makes more sense to me. Would it be possible to make this optional?

@pbek
Copy link
Owner

pbek commented Jun 13, 2023

Do you consider using code block in headlines "good-practice"? I don't know if I've seen anyone doing that. Would also would look ugly when you link to a headline...

And it possibly would be hard on the CPU of slower computers if a Markdown parser would be fired up a few 100 times for a few 100 headlines each time something changes in the note. 🤔

@pbek
Copy link
Owner

pbek commented Jun 13, 2023

Opinions, @Waqar144?

@Waqar144
Copy link
Contributor

We should only strip them out if we can render it according to the markdown syntax. Otherwise it can be misleading imo

@pbek
Copy link
Owner

pbek commented Jun 13, 2023

Yes, good point. We still would need to interpret the headings, "kind of"... Otherwise, we would remove single *, ~ or _ to...

@pbek pbek changed the title [BUG] Backticks are not filtered in navigation list (panel) preview Backticks are not filtered in navigation list (panel) preview Jun 13, 2023
@pbek pbek changed the title Backticks are not filtered in navigation list (panel) preview Backticks are not filtered in navigation list Jun 13, 2023
@pbek pbek added Type: Feature adds functionality Importance: Low and removed Type: Support labels Jun 13, 2023
@patvdv
Copy link
Sponsor Author

patvdv commented Jun 13, 2023

Do you consider using code block in headlines "good-practice"? I don't know if I've seen anyone doing that. Would also would look ugly when you link to a headline...

And it possibly would be hard on the CPU of slower computers if a Markdown parser would be fired up a few 100 times for a few 100 headlines each time something changes in the note. 🤔

I use it all the time in technical notes. When referring to host names for example I prefer these to be indicated by a monospace type. Wikis typically have a preformatted markup for this, like a double single quote in Dokuwiki or the tripe single quote in Mediawiki. The backtick is the only way to achieve this in markdown AFAIK. And it does work! But cannot comment on the (CPU) efficiency.

@pbek
Copy link
Owner

pbek commented Jun 13, 2023

Dunno, those Wikis don't use Markdown by default, don't they?

@patvdv
Copy link
Sponsor Author

patvdv commented Jun 14, 2023

No, they don't. Most wiki have their own markup language with often commonalities. I just the example for the sake of a comparison only.

For me this is not a major issue, consider it a nice to have for the future. IMHO, it makes sense to see the markup in the navigation panel when working in an edit layout. Likewise, it would make sense to show a rendered navigation panel when the app is in a preview-only mode. I am not sure how to resolve this consistently as you can have an edit & preview panel in the same workspace of course. I prefer to keep them separate to save screen space.

@pbek
Copy link
Owner

pbek commented Jun 16, 2023

There is no "preview only mode"... Workspaces are complete free to generate.

I wanted to try to strip the characters, but it's not easy to do that without stripping too many, so one would need to write a pseudo Markdown parser to only strip those of formattings and then strip the correct white spaces between the words, like in:

## test * test

## test ~ test

@pbek
Copy link
Owner

pbek commented Jun 16, 2023

Something like this:

image

@pbek
Copy link
Owner

pbek commented Jun 16, 2023

23.6.5

  • Markdown is now stripped out of the heading text in the navigation panel to
    improve readability (for #2791)

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

@patvdv
Copy link
Sponsor Author

patvdv commented Jun 17, 2023

23.6.5

* **Markdown is now stripped** out of the heading text in the **navigation panel** to
  improve readability (for [#2791](https://github.com/pbek/QOwnNotes/issues/2791))

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

Hi,

I installed the new release and it looks perfect to me. Many thanks for the fix! Perhaps to consider for other users: making this feature optional or not. For me it would certainly be the default to have the markup filtered in the navigation panel.

@pbek
Copy link
Owner

pbek commented Jun 17, 2023

Thank you for testing!
Is don't really see a reason to make this optional, since Markdown syntax in the navigation is pretty distracting (as it is in the heading itself, in my opinion 😅).

@pbek pbek closed this as completed Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants