Conversation
…rbitrary letter fallback to unordered list
|
Hey @kfiven, can you please review this PR and share your feedback |
|
https://github.com/cinnyapp/cinny/blob/dev/CONTRIBUTING.md#ai-usage As per their contribution policy, no AI code is allowed. |
|
I reviewed the AI generated Code by myself. I don't think this might generate any problem in future. |
|
Hi @Yashh56 |
|
Hey @kfiven, thanks for clarifying. I understand the concern regarding the new policy and the licensing aspects of AI-generated code. I’ll make sure to review and understand the code myself before submitting any further contributions and follow the project’s contribution guidelines going forward. |
|
Hey @kfiven, Should I close this PR now and recreate a new one or make changes in it? |
|
Hi, A new one will be better. |

PR Description
Summary
This PR introduces a series of robust fixes to the Markdown parser and UI rendering engine. It addresses multiple edge cases in both block- and inline-Markdown parsing, ensuring that complex combinations—such as nested lists, blockquotes containing lists, and nested inline elements—are formatted precisely to specification.
It also resolves a UI styling conflict with spoiler elements.
Key Changes
1. Block-Level Parsing
Nested Lists: Refactored indentation tracking (
buildListstack) to accurately map indentation depths, ensuring nested lists are generated with the correct hierarchy rather than being flattened.Ordered Lists:
10.,100.), which were previously failing to parse.a,A,i,I), preventing arbitrary letters (e.g.,Q.) from erroneously triggering list creation.-metadata attribute, accidentally converting them to unordered lists.Unordered Lists: Fixed
getListTypeto properly recognize hyphens (-) alongside asterisks (*) as valid unordered list markers.Blockquotes: Enabled recursive parsing inside
BlockQuoteRule, allowing internal block elements (such as lists or headings) to be formatted correctly within a quote rather than rendering as raw text.2. Inline-Level Parsing
Rule Precedence: Moved
CodeRuleintoLeveledRulesto fix regex precedence issues. This prevents inline code blocks from prematurely splitting strings, which previously broke outer syntax such as links or spoilers containing code.Escaped Characters: Added
\[and\]toINLINE_SEQUENCE_SETso that escaped square brackets are correctly unescaped and ignored by the link parser.3. UI & Styling
Spoiler Visibility: Fixed a styling conflict where child elements inside an unrevealed spoiler (such as
<code />blocks with distinct backgrounds/colors) remained visible.Used Vanilla Extract's
globalStyleto applyopacity: 0to all descendants of an unrevealed spoiler, ensuring everything is completely hidden until clicked.Testing
10. Foo).Q. Foo) are gracefully parsed as regular paragraphs.\[bracket\]) render as raw text.||) properly mask inline<code />blocks.Close: #2845