0

Starting with a plain text document (markdown), I'm trying to create a CSS file that will correctly interpret the ordered list in the .md file with APA-style outlining.

Here's an excerpt of the CSS code:

ol {list-style-type: upper-roman;
}
ol ol {list-style-type: upper-alpha;
}
ol ol ol {list-style-type: decimal;
}
ol ol ol ol {list-style-type: lower-roman;
}
ol ol ol ol ol {list-style-type: upper-roman;
}
ol ol ol ol ol ol {list-style-type: disc;
}

What I get is hard to reproduce in HTML so I uploaded this:

see screenshot

I've tried experimenting with the counter-increment and counter-reset elements but have had no luck. Been studying this old post but haven't got it right yet. Do I need to alternate ul with ol, or ol with li?

EDIT: Adding the web inspector view for clarification.

inspector screenshot

EDIT 2: Markdown Source File Contents:

  1. This
    1. Is
      1. An
        1. Example
          1. Of an
            1. Outline Behaving
              1. Badly

Currently using Obsidian (in beta) to render the markdown text and have been using various CSS sheets, including the default. Other users have been unable to reproduce the issue so it's something on my machine apparently. I don't know which markdown language I'm using, I'm thinking it's basic and not multimarkdown. The Obsidian app has some built-in CSS but the user's CSS file should override it.

I can withdraw the question, just looking for ideas. Should I paste the whole CSS file?

s0ph0s
  • 1
  • 2
  • Can you change the HTML markup? Use start to reset the ordered list.
      – yinsweet May 26 '20 at 00:40
    1. What Markdown source are you using? Which Markdown implementation? This should "just work". – ChrisGPT was on strike May 26 '20 at 01:31
    2. @yinsweet Thanks, I had already tried that and it works, but since I want this particular code snippet to work and be re-usable in various settings, and it seems like something else is affecting it, I didn't want to have to force the code when it seems there should be a more _orthodox_ solution(?) If that's the way it has to be, that's OK. Feels like I'm missing something though. – s0ph0s May 26 '20 at 02:45
    3. @Chris It's just plain text with some decimal numbering and tab-indents. Nothing fancy with the source .md (text) file. Glad to hear it should work the way it's written, though. There's probably something else in the parent program or file that is affecting the output. I'm using someone else's stylesheet and there is probably something else overriding the changes. I've tried the !important element but that doesn't work either. I'd post the whole thing here but I'm not sure how to do it without taking up a whole screen. – s0ph0s May 26 '20 at 02:48
    4. @yinsweet I added another screenshot. Notice how it starts with "8"? It's doing that because the source file is literally numbered 8. Either that or it's just the 8th line. Shouldn't it reinterpret it as just the next ordered list element and forget the actual number, but start again at the beginning of the section? – s0ph0s May 26 '20 at 02:54
    5. It should start again at the beginning of the section if didn't specify the order number. – yinsweet May 26 '20 at 03:18
    6. @s0ph0s, you still haven't shown any Markdown source or told us which Markdown tool you're using to convert it. The `start` attributes aren't standard behaviour. – ChrisGPT was on strike May 26 '20 at 18:59
    7. As Chris stated, most Markdown parsers don't add `start` attributes. Check to see if the parser has an option to turn that off, or let us know which implementation you are using and maybe we can help you with that. – Waylan May 26 '20 at 19:13
    8. @Chris Apologies, I didn't think the text mattered since it was a simple list. I've added it now. It parses fine in Marked 2 and other rendering agents. – s0ph0s May 26 '20 at 23:16
    9. @Waylan I've been all over the inspector view and tried turning off and on several options but haven't had any luck yet. – s0ph0s May 26 '20 at 23:16
    10. You misunderstand. Which tool are you using to convert the Markdown to HTML? It would appear that that tool is inserting the `start` attributes. It has nothing to do with CSS or the browser. – Waylan May 27 '20 at 18:46
    11. I think I got it. The rendering engine in Obsidian seems to have a problem with the counter-reset, as [@Chris] [@yinsweet] and [@Waylan] described. I just couldn't prove it until trying a few different outline source files. Next step is verifying the issue with developers.... – s0ph0s May 28 '20 at 03:59

    0 Answers0