greasyfork-org / greasyfork

An online repository of user scripts.
https://greasyfork.org
GNU General Public License v3.0
1.47k stars 441 forks source link

In comments to script Feedback posts, in order to force a line return using Markdown, in 'Preview' tab you have to put two empty spaces at the end of a line, but when posting the comment these two spaces become two separate line returns #752

Closed darkred closed 4 years ago

darkred commented 4 years ago

I've noticed the following in the redesigned discussion while using Markdown (when creating a discussion post/comment):

If I use 2 spaces for a newline e.g.

aaa__  <--- 2 spaces
bbb

then in the Preview tab it shows it as expected, i.e.

aaa
bbb

but when I submit the post/comment, it takes each space for a newline, making up two newlines in total:

aaa  <-- 1st newline
     <-- 2nd newline 
bbb
JasonBarnabe commented 4 years ago

I believe this was because it was reading the incorrect format for the preview (it was seeing the choice for other, invisible forms on the page). Should be fixed now.

darkred commented 4 years ago

Thank you very much for the quick response.

I don't know if it's related, but now the following issue occurs: although I have set Markdown as the preferred markup, 2020-08-01_191453 the HTML radiobox now gets preselected in new discussion page: 2020-08-01_191511 This didn't occur previously.

darkred commented 4 years ago

Also, the OP's issue unfortunately still occurs:

I just posted a comment in https://greasyfork.org/en/scripts/12179-greasyfork-bull-filter/discussions/58257#comment-150905 and, for testing I used 1 space for newlines in the Markdown: well, even though in the Preview tab it showed that 2 spaces were needed to make a newline, I submitted the comment with 1-space as newlines, and the newlines were created in the actual comment.

I believe 2 spaces should be needed for newlines in Discussions, not 1, just like it currently is in script pages|Update|'Additional info'. (relevant old issue: #389 )

JasonBarnabe commented 4 years ago

I don't know if it's related, but now the following issue occurs: although I have set Markdown as the preferred markup, the HTML radiobox now gets preselected in new discussion page

This is fixed now.

JasonBarnabe commented 4 years ago

I don't really understand the original issue. Are you referring to spaces (like with the spacebar) or line breaks (with Enter)? When I try it, I don't see any difference between preview and the end result.

darkred commented 4 years ago

What I mean is that if I use 1-space (yes with the spacebar) in the end of each line,
they are rendered as newlines in the submitted post (not in the Preview). These 1-space should not be rendered as newlines in the submitted post, because they are not 2-space.

In details: Here is the Markdown from my comment above:

Sorry, but I can't help with that.

---

Just one (irrelevant) thing, in order the script to also work in script feedback listings: 
The latest script version is 2020.7.31. 
I had made a mistake and posted an intermediate version as 2020.30.7 (and then 2020.30.7.1) 
and now it cannot automatically update to it 2020.7.31 (it considers it a previous version), 
and if you manually update it, it will show it as a "version donwgrade".

So, please ignore that "downgrade" warning and proceed with installing the latest version.

i.e. here are my 1-spaces:

Markdown in editbox ![2020-08-02_101011](https://user-images.githubusercontent.com/723651/89117720-af5e2b80-d4a8-11ea-95e5-34758e6502e0.jpg)

and here is how they are rendered in the 'Preview' tab: (as expected)

Preview ![2020-08-02_101302](https://user-images.githubusercontent.com/723651/89117743-e46a7e00-d4a8-11ea-86f8-dede920aefbb.jpg)

and here is how they are rendered after I submit it: (as newlines)

Submitted ![2020-08-02_101436](https://user-images.githubusercontent.com/723651/89117766-08c65a80-d4a9-11ea-95da-5c9fcd52b842.jpg)
darkred commented 4 years ago

@JasonBarnabe Any update on this issue? Sorry if my description in the initial post wasn't very descriptive, but what I'm refering to Markdown's Line Return:

To force a line return, place two empty spaces at the end of a line.

 

That is, in Discussions, If I use this Markdown:

Markdown

Forcing a line-break\s\s
Next line in the list

I'm getting:

Output in 'Preview' (1 line return, as expected)

Forcing a line-break<br>
Next line in the list

Output in submitted post/comment (2 line returns)

Forcing a line-break<br>
<br>
Next line in the list
JasonBarnabe commented 4 years ago

I don't see that. I get one line break. Can you post a discussion in the forum with just that and I can take a look? I suspect it may be a CR vs LF thing.

darkred commented 4 years ago

Here, my latest comment in https://greasyfork.org/en/scripts/12179-greasyfork-bull-filter/discussions/59057#comment-152364

How it's displayed in the 'Preview' tab: (the two-space trailing spaces are at the arrows): 2020-08-10_105320

The submitted comment: 2020-08-10_105525

darkred commented 4 years ago

In addition to the above comment links I took the liberty of making this separate test post+comment in "Greasy Fork Feedback" and the issue doesn't occur: the line returns are rendered ok in both.

I also made this script Feedback post and it also works ok.


BUT, the issue occurs when I wrote a comment for a script Feedback post (for a a script of mine) :

Markdown:

Great to hear.  
I'm glad you find it useful.

My posted comment: 2020-08-11_161731

JasonBarnabe commented 4 years ago

OK, so the problem was when the page previously rendered an HTML comment, the HTML config was bleeding into the Markdown config. It should be fixed now and the extra whitespace is gone.

darkred commented 4 years ago

Thank you for fixing this.

decembre commented 3 years ago

Maybe it's related: I have some problem to have a new line when i write the description of my script: If hit "enter" to have a new line, i have no new line after posting. To have the new line, i need hit the key board "enter" twice.

And i don't understand how list are applied, seems very confusion. GRESYFORK - SCript info new line PB - 2021-01-17_193938

Here a screenshot of the problem (before i try to "fix" it for my userscript: Userstyles / Greasy Fork Enhancer Dark-Grey - UserCSS (userstyle)