PublicLab.Editor icon indicating copy to clipboard operation
PublicLab.Editor copied to clipboard

Numbering is reset if there are photos in the list

Open shapironick opened this issue 6 years ago • 4 comments

I went in to edit this note and after doing something unrelated to a list that I had in there with instructions the numbered list of instructions started not working properly.

It looks like this in the editor: screen shot 2018-02-25 at 11 04 34 pm But looks like this when displayed: screen shot 2018-02-25 at 11 05 14 pm

It wasn't an issue in the note as originally published and I did not click the rich text editor button.

shapironick avatar Feb 26 '18 04:02 shapironick

This is a doozy -- very frustrating for any Markdown system. It is an upstream issue but I wish we could think about a clever way around it.

Basically, and as I type this i'll demo it on GitHub's Markdown:

  1. adding an image (or other things like tables) inserts new lines, essentially "ending" the numbered list.

pl-narrow

  1. Markdown doesn't know how to detect that you want to "resume" a prior numbered list instead of starting a new one.
  2. hello

However it seems GitHub has modified Markdown to change this behavior, so I think we could too...

My thought is -- maybe we can modify standard markdown behavior in a few ways:

  1. not auto-convert all numbered lists to just 1., 1., 1., which some Markdown parsers do because this is a widely held belief that Markdown should handle the actual incrementing so you can easily add a number in the middle of a list and not have to renumber it (try this in the preview function of GitHub comments to see it happening). So we'd disable woofmark's auto-conversion if it does that (i think it does)
  2. (this would have to be an upstream change to woofmark) so that if a numbered list starts with a digit other than 1, we start numbering from that

Having played with GitHub's Markdown system, I think that's what's happening here, or pretty close. We can implement 1. ourselves right now, and then file 2. with the Woofmark maintainers and try to get that adopted there, citing that GitHub does this.

How does this sound?

jywarren avatar Mar 01 '18 16:03 jywarren

sounds good to me! and the funny thing is that the numbering worked when i wrote the original note in an earlier version of the editor (just markdown I think) but when i went in to edit something else it broke.

But yes! sounds like a great way forward, thank you!

On Thu, Mar 1, 2018 at 11:47 AM, Jeffrey Warren [email protected] wrote:

This is a doozy -- very frustrating for any Markdown system. It is an upstream issue but I wish we could think about a clever way around it.

Basically, and as I type this i'll demo it on GitHub's Markdown:

  1. adding an image (or other things like tables) inserts new lines, essentially "ending" the numbered list.

[image: pl-narrow] https://user-images.githubusercontent.com/24359/36857033-195a0994-1d3d-11e8-9b71-02d284a91c39.png

  1. Markdown doesn't know how to detect that you want to "resume" a prior numbered list instead of starting a new one.
  2. hello

However it seems GitHub has modified Markdown to change this behavior, so I think we could too...

My thought is -- maybe we can modify standard markdown behavior in a few ways:

  1. not auto-convert all numbered lists to just 1., 1., 1., which some Markdown parsers do because this is a widely held belief that Markdown should handle the actual incrementing so you can easily add a number in the middle of a list and not have to renumber it (try this in the preview function of GitHub comments to see it happening). So we'd disable woofmark's auto-conversion if it does that (i think it does)
  2. (this would have to be an upstream change to woofmark https://github.com/bevacqua/woofmark) so that if a numbered list starts with a digit other than 1, we start numbering from that

Having played with GitHub's Markdown system, I think that's what's happening here, or pretty close. We can implement 1. ourselves right now, and then file 2. with the Woofmark maintainers and try to get that adopted there, citing that GitHub does this.

How does this sound?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/PublicLab.Editor/issues/128#issuecomment-369654402, or mute the thread https://github.com/notifications/unsubscribe-auth/AHJ97x5sHXbPy-dDIDvMeOSmAK-2bAOpks5taCYDgaJpZM4SSpvR .

shapironick avatar Mar 01 '18 19:03 shapironick

@jywarren @shapironick I just checked this out and it works as long as you add the image after saving the number list fyi if you want to fix your research note!

sashadev-sky avatar Oct 23 '20 15:10 sashadev-sky

very cool, thanks!

On Fri, Oct 23, 2020 at 8:33 AM Sasha Boginsky [email protected] wrote:

@jywarren https://github.com/jywarren @shapironick https://github.com/shapironick I just checked this out and it works as long as you add the image after saving the number list fyi if you want to fix your research note!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/PublicLab.Editor/issues/128#issuecomment-715415384, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZH334MAVAFTTP2YQJCYB3SMGO3PANCNFSM4ESKTPIQ .

-- Nicholas Shapiro Assistant Professor UCLA Institute for Society and Genetics Office: (310) 206-2366

shapironick avatar Oct 23 '20 17:10 shapironick