Code Monkey home page Code Monkey logo

Comments (8)

pbek avatar pbek commented on June 18, 2024

Hm, the used "algorithm" searches for the previews heading that is one level higher, that is ### 1.1.3 in your example, since you skipped the proper ### heading after ## 2.2.

from qownnotes.

blue-baloon avatar blue-baloon commented on June 18, 2024

Hm, the used "algorithm" searches for the previews heading that is one level higher, that is ### 1.1.3 in your example, since you skipped the proper ### heading after ## 2.2.

Yeah, I skipped h3...

Like I said, maybe I use the hierarchy in a 'particular' way, but I thought the algorithm should also consider the typing position in the file.

To explain better, I always start typing subjects using h4 and under it I put

(normal text) to explain in details, if the issue belongs to some group, I add h3, h2 and h1 to organize it, for better understanding and visualization of priorities.

If what I did is considered wrong, I apologize and ask you to close the issue

Sorry for my English

from qownnotes.

pbek avatar pbek commented on June 18, 2024

If what I did is considered wrong, I apologize and ask you to close the issue

"Wrong" is a harsh word. 😊 It's more like in HTML or Markdown you are not supposed to skip heading level...

The current implementation of finding a suitable parent is:

/**
* Attempts to find a suitable parent item for the element type
*/
QTreeWidgetItem *NavigationWidget::findSuitableParentItem(int elementType) const {
--elementType;
auto lastHigherItem = _lastHeadingItemList.value(elementType);
return (lastHigherItem == nullptr && elementType > MarkdownHighlighter::H1)
? findSuitableParentItem(elementType)
: lastHigherItem;
}

Works great for a valid Markdown heading structure. ️🤷🏻

from qownnotes.

blue-baloon avatar blue-baloon commented on June 18, 2024

If what I did is considered wrong, I apologize and ask you to close the issue

"Wrong" is a harsh word. 😊 It's more like in HTML or Markdown you are not supposed to skip heading level...

The current implementation of finding a suitable parent is:

Works great for a valid Markdown heading structure. ️🤷🏻

Yeah, like you said, it's not recommended.

I took a quick read at this interesting discussion about this topic:
Heading off confusion
The entire text is interesting, but the comments are gold... No consensus at all if skipping headings should be considered wrong (prohibited) or just 'non-recommended' but acceptable.

Initially, when i opened the ticket I just wanted to show this 'unexpected' behavior to the devs; well, it's done.
If you consider the behavior normal, well, I'll adapt and live with this.

You've been very kind regarding this issue, thank you!

And again, sorry for my broken English

from qownnotes.

pbek avatar pbek commented on June 18, 2024

You've been very polite too! 🙏🏻
I'm not even sure on how easy it would be to do anything about it and if it would cause problems in different cases...

from qownnotes.

pbek avatar pbek commented on June 18, 2024

Phew, it's rather hard to find a more suitable parent item if the structure isn't valid...

from qownnotes.

github-actions avatar github-actions commented on June 18, 2024

This issue is stale because it has been open for 30 days with no activity.

from qownnotes.

github-actions avatar github-actions commented on June 18, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

from qownnotes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.