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

Quoted blocks removed when visiting topics #45

Closed
PuercoPop opened this issue Dec 28, 2018 · 8 comments
Closed

Quoted blocks removed when visiting topics #45

PuercoPop opened this issue Dec 28, 2018 · 8 comments
Labels
bug upstream An upstream bug we have to live with

Comments

@PuercoPop
Copy link
Contributor

In particular I've encountered this behaviour in this Pull Request

stumpwm/stumpwm#544 (comment)

image

Note that there is a line with one empty space where the quoted block should be. Also I verified in the SQLite database that the quoted blocks are present

@vermiculus
Copy link
Contributor

vermiculus commented Dec 28, 2018

This might be a gfm-mode setting; did you check any variables that might be hiding markup? (My wife is hoarding my laptop right now but I think it's labeled as some sort of 'clean' mode.)

@PuercoPop
Copy link
Contributor Author

This might be a gfm-like setting; did you check any variables that might be hiding markup? (My wife is hoarding my laptop right now but I think it's labeled as some sort of 'clean' mode.)

I can't find anything that might be doing so, but you've given me an idea. It may be that markdown-mode may be interpreting the content as the lang of the code-block as the whole quoted text is one line with triple backticks

@vermiculus
Copy link
Contributor

vermiculus commented Dec 29, 2018

the whole quoted text is one line with triple backticks

Considering that's not how quotes are formatted in markdown, I'd say it's a safe bet that it's not going to be interpreted as a quote :-) Quotes are formatted thus:

> this is a quote

For posterity, I'm pretty sure the variable I was thinking of is markdown-hide-markup-in-view-modes.

@PuercoPop
Copy link
Contributor Author

@vermiculus Yes, I quote with > but I don't control how other people use markup. Thanks for the pointer of markdown-hide-markup-in-view-modes but that didn't do the trick. Although I suspect the 'bug' is more likely to be in markdown-mode, I'll look into it. Thanks for the pointers again!

@vermiculus
Copy link
Contributor

I find it unlikely that markdown-mode will ever do what you're asking it to do (which is to effectively ignore the most basic syntax rules of markdown!), but you might be able to hack the regular expressions markdown-mode uses to recognize quote blocks. You'll have better luck convincing others to use markdown correctly, I think :-)

It is odd though that from getting the fontified text in forge--fontify-markdown to inserting it in forge-topic-refresh-buffer, we seem to loose the content in ```triple quotes```.

@tarsius
Copy link
Member

tarsius commented Jun 21, 2019

one

two

three

@tarsius
Copy link
Member

tarsius commented Jun 21, 2019

markdown-mode sets invisible to markdown-markup for all of

```text```

If the delimiters are just one or two backquotes, then it doesn't do that. At least gfm-mode shouldn't treat three backquotes the same as two because three opening and closing backquotes on the same line is valid gfm syntax and in that case the text part is not part of the markup its the content, unlike in

```language
content
```

where language is part of the markup.


The reason that setting markdown-hide-markup-in-view-modes is that it only affects the buffer in which the parsing happens. If we copy text from there into another buffer, then the invisible property still has the normal affect. As a workaround do this in the topic buffer:

(remove-from-invisibility-spec 'markdown-markup)

@tarsius tarsius added bug upstream An upstream bug we have to live with awaiting Further information is requested and removed help wanted labels Jun 21, 2019
@tarsius
Copy link
Member

tarsius commented Jul 4, 2020

Fixed with jrblevin/markdown-mode#492.

@tarsius tarsius closed this as completed Jul 4, 2020
@tarsius tarsius removed the awaiting Further information is requested label Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug upstream An upstream bug we have to live with
Projects
None yet
Development

No branches or pull requests

3 participants