lists.scss: reset <ol> without 'type' attr to "decimal"#1420
lists.scss: reset <ol> without 'type' attr to "decimal"#1420simurai merged 2 commits intoprimer:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 55302dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Tried the reproduce this issue and yes... the following saved as I guess this logic comes from css/src/base/typography-base.scss Lines 49 to 59 in efbd3a6 |
src/markdown/lists.scss
Outdated
|
|
||
| // Reset <ol> style to decimal (HTML default) specifically for AsciiDoc | ||
| // <div><ol> construction (doesn't affect MarkDown) | ||
| div ol:not([type]) { |
There was a problem hiding this comment.
Yeah, it seems the <div> as a wrapper is the only thing that differentiates AsciiDoc and MarkDown. @hpalacio Should we use the > child selector to make it even more specific?
| div ol:not([type]) { | |
| div > ol:not([type]) { |
There was a problem hiding this comment.
Definitely! I missed that.
Thanks
There was a problem hiding this comment.
Fixed-up the commit with child selector div > ol
HTML default list-style-type is "decimal" when there is no 'type' attribute. In MarkDown language, you can't specify the style type of a list item, so nested lists *always* represent with decimal numbers at any level. Since this is not user friendly, GitHub CSS styling overrides the HTML standard by setting lower-roman for second-level items and lower-alpha for third-level items. In AsciiDoc language, you can specify the style type of a list item using a tage before the list, for example: Tag Produces [loweralpha] <ol type="a"> [lowerroman] <ol type="i"> [decimal] <ol> The [decimal] tag doesn't generate any 'type' attribute because the HTML standard when there is no type, *is* decimal. If such a [decimal] tag is used on a second-level or third-level item, GitHub CSS for MarkDown overrides HTML standard and you get instead a lowerroman or loweralpha sign. The added CSS resets the list-style-type of <ol> without type to decimal, as it should be in the first place, for the construction div > ol, which is only produced by AsciiDoc files, to avoid any effect on existing MarkDown files. Signed-off-by: Hector Palacios <hector.palacios@digi.com>

HTML default list-style-type is "decimal" when there is no 'type'
attribute.
In MarkDown language, you can't specify the style type of a list
item, so nested lists always represent with decimal numbers at
any level. Since this is not user friendly, GitHub CSS styling
overrides the HTML standard by setting lower-roman for second-level
items and lower-alpha for third-level items.
In AsciiDoc language, you can specify the style type of a list
item using a tage before the list, for example:
The [decimal] tag doesn't generate any 'type' attribute because
the HTML standard when there is no type, is decimal.
If such a [decimal] tag is used on a second-level or third-level
item, GitHub CSS for MarkDown overrides HTML standard and you get
instead a lowerroman or loweralpha sign.
The added CSS resets the list-style-type of
<ol>without type todecimal, as it should be in the first place, for the construction
div > ol, which is only produced by AsciiDoc files, to avoid any effect
on existing MarkDown files.