gdocs2md-html icon indicating copy to clipboard operation
gdocs2md-html copied to clipboard

Lists items should not be indented

Open katylava opened this issue 10 years ago • 2 comments

This turns my list items into > <sub>* a list item. I can't dedent my lists any further in Google Docs. I would expect list items to be just * a list item.

katylava avatar Jan 11 '16 22:01 katylava

Sorry for the late reply, hadn't seen this!

I've seen this behaviour, and basically it's a quirk of Google Docs I can't figure out - if you indent at some point and then de-indent it'll 'remember'. The indent level is recorded as changed, becoming non-whatever the initialisation value is.

I always make documents from scratch in plain-text format (e.g. without pasting in website-formatted bits), and avoid it, but really this is just a best-available convenience tool, and it's always best to have a check over (find and replace on the output as necessary).

The relevant part of the text processing is done here if you really want to have a go at seeing if the behaviour's fixable, it's a flaw in Google Docs' inconsistent recording of indentation though as far as I can see. If you're not using indent to mean blockquote then feel free to set the variable on > <sub> this line to "".

If I remember rightly, the nesting level starts at null, indentation and then reindentation increases it to say "2" and then down to "0", so it's the comparison between null and 0 that's the problem.

Apologies that I can't be more specific, it was a while ago I stepped through the code, but the debugger on Apps Script script editor is very good, and shows all the relevant values if you add a breakpoint at the 'getNestingLevel' section.

I don't suppose you could sharing a reproducible example of a doc that causes this? That might help diagnose it.

lmmx avatar Mar 18 '16 01:03 lmmx

Same issue here. Basic bullet points with indent not used. Have switched bullets on off, and made sure indent is as minimal as possible.

Your suggestion to change indent_prefix works for the docs I am doing as we are not using indent as quotes. If you still need an example doc I can share it.

cogdog avatar May 09 '17 18:05 cogdog