dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.62k stars 252 forks source link

wikilinks within broken lists do not get parsed #1016

Open SeriousBug opened 3 years ago

SeriousBug commented 3 years ago

Please select the area your Bug applys to. (Multiple selections are Possible)

Describe the bug

A wikilink within a broken list does not get parsed as a wikilink. As a result, syntax highlighting and backlinks are broken.

To Reproduce

  1. In any note, write the following:
    - [ ] [[good]]
    - [n] [[bad]]
  2. Ctrl+click each link to create the notes.

At this point, you'll find that [[good]] is highlighted, but [[bad]] is not. If you go to these notes, good will have a backlink, but bad will not.

Expected behavior

These links should also get parsed, at which point highlighting and backlinks will work.

Desktop (please complete the following information)

Additional context

Apart from just getting wikilinks inside bad lists to parse, I think a good option could be to create a custom list parser that allows customizable checkmark markers. This could be as simple as defining unicode symbols in dendron.yml, which are overlaid on top of the checkmark in publishing & HTML preview. Here is a mockup of what I mean:

andrey-jef commented 2 years ago

Just wanna leave a report about the similar situation that I recently encounter when I'm writing my note

[PythonForFinance | Build a Financial Data Database with Python](https://pythonforfinance.net/2020/10/24/build-a-financial-data-database-with-python/)
    - data pipeline mindmap
    ![data-pipeline](https://pythonforfinance.net/wp-content/uploads/2020/10/DataPipeline-1170x638.jpg){max-width: 300px, display: block, margin: 0 auto}

When I indent the bullet and image link by 4 spaces, the Note Preview doesn't show the image, as in my screencap below. Screenshot 2022-01-21

If I indent the bullet and image link by only 2 spaces, the image is displayed correctly.

ScriptAutomate commented 2 years ago

Just wanna leave a report about the similar situation that I recently encounter when I'm writing my note

[PythonForFinance | Build a Financial Data Database with Python](https://pythonforfinance.net/2020/10/24/build-a-financial-data-database-with-python/)
    - data pipeline mindmap
    ![data-pipeline](https://pythonforfinance.net/wp-content/uploads/2020/10/DataPipeline-1170x638.jpg){max-width: 300px, display: block, margin: 0 auto}

When I indent the bullet and image link by 4 spaces, the Note Preview doesn't show the image, as in my screencap below. Screenshot 2022-01-21

If I indent the bullet and image link by only 2 spaces, the image is displayed correctly.

Just adding extra notes that @andrey-jef may be experiencing intended behavior, maybe related to github flavored markdown (GFM)? It looks GFM doesn't like it in general if you use four spaces before the first item in a list.

Examples

No indent
- Yo!
  - What!

Two space indent
  - Yeah

Four space indent
    - What?!

Nested list where first line starts with 2 space indent, next line with 4 space indet
  - Hey
    - Hello

Nested list where second line starts with 6 space (so, four more than first line)
  - Hey
      - Yo

Rendered

No indent

Two space indent

Four space indent with no line break inbetween (doesn't render to list)

Four space indent with line break between (renders to code block)

- What?!
- Hello?!

Nested list where first line starts with 2 space indent, next line with 4 space indet

Nested list where second line starts with 6 space (so, four more than first line)

ychen01 commented 2 years ago

I notice that when the checkbox is directly followed by a wiki link such as -[ ] [[mypage]] , the preview cannot parse/display the wiki link.
My workflow is to track the task using scratch notes, my current workaround is to insert random character between checkbox and wiki link.

SeriousBug commented 2 years ago

@ychen01 Does it work if you add a space before it? I think that might be broken:

- [ ] [[mypage]]
ychen01 commented 2 years ago

@ychen01 Does it work if you add a space before it? I think that might be broken:

- [ ] [[mypage]]

- [ ] [[mypage]] with space --> OK - [w] [[mypage]] with space --> Not OK So adding the task status as w, x, breaks the wiki links after, even with spaces

kevinslin commented 2 years ago

Did some digging. Seems like this is happening because unified is parsing [ ] as a LinkReference

Wrote my findings in [[Syntax Highlighting Issue|dendron://private/task.2022.03.12.syntax-highlighting-issue]]

ScriptAutomate commented 2 years ago

Just wanted to drop in and say I'm experiencing this, myself.

  - [ ] [[Working wikilink|my.note.yo]]
  - [w] [[Breaks wikilink|my.note.yo]]
  - [w] Go to [[Working wikilink|my.note.yo]]

If I add some characters between the checkbox and the wikilink, it causes it to work again.