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

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 opened this issue Jul 31, 2020 · 13 comments

Comments

@darkred
Copy link

darkred commented Jul 31, 2020

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
Copy link
Collaborator

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
Copy link
Author

darkred commented Aug 1, 2020

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
Copy link
Author

darkred commented Aug 1, 2020

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

darkred commented Aug 2, 2020

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

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

Preview

2020-08-02_101302

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

Submitted

2020-08-02_101436

@darkred darkred changed the title In Discussions, when using Markdown, preview takes 2 spaces for a newline, but when submitting the post it uses 1 space for newline In Discussions, when using Markdown, in order to force a line return, in 'Preview' tab you have to end the line with 2 spaces, but when submitting the post/comment, these 2 spaces are rendered as two separate line returns Aug 9, 2020
@darkred
Copy link
Author

darkred commented Aug 9, 2020

@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
Copy link
Collaborator

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
Copy link
Author

darkred commented Aug 10, 2020

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
Copy link
Author

darkred commented Aug 11, 2020

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

@darkred darkred changed the title In Discussions, when using Markdown, in order to force a line return, in 'Preview' tab you have to end the line with 2 spaces, but when submitting the post/comment, these 2 spaces are rendered as two separate line returns 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 Aug 11, 2020
@JasonBarnabe
Copy link
Collaborator

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
Copy link
Author

darkred commented Aug 14, 2020

Thank you for fixing this.

@decembre
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants