Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulleted list does not indent properly #290

Open
1 task done
ykphuah opened this issue Dec 3, 2022 · 1 comment · May be fixed by #291
Open
1 task done

Bulleted list does not indent properly #290

ykphuah opened this issue Dec 3, 2022 · 1 comment · May be fixed by #291

Comments

@ykphuah
Copy link
Contributor

ykphuah commented Dec 3, 2022

Please help prevent duplicate issues before submitting a new one:

  • I've searched other open/closed issues for duplicates before opening up this new issue.

Report

What did you do?

Convert markdown text to attributed string, with bulleted lists spanning multiple lines.

  • 123
  • 456 456 456 456 456 456 456 456 456 456 456 456 456 456 456
  • 789

What did you expect to happen?

The bulleted list to be indented properly.

What happened instead?

The bulleted list is not indented properly.

Screenshot 2022-12-03 at 3 41 59 PM

@ykphuah
Copy link
Contributor Author

ykphuah commented Dec 3, 2022

I tried looking into the codes, and found out that by commenting this one line, the indent showed up ok.

diff --git a/Sources/Down/AST/Styling/Helpers/ListItemParagraphStyler.swift b/Sources/Down/AST/Styling/Helpers/ListItemParagraphStyler.swift
index 71313bd..ab76f30 100644
--- a/Sources/Down/AST/Styling/Helpers/ListItemParagraphStyler.swift
+++ b/Sources/Down/AST/Styling/Helpers/ListItemParagraphStyler.swift
@@ -70,7 +70,7 @@ public class ListItemParagraphStyler {
         let firstLineContentIndentation = contentIndentation + prefixSpill
 
         let style = baseStyle
-        style.firstLineHeadIndent = prefixIndentation
+        // style.firstLineHeadIndent = prefixIndentation
         style.tabStops = [tabStop(at: firstLineContentIndentation)]
         style.headIndent = contentIndentation
         return style

Screenshot 2022-12-03 at 3 47 27 PM

It does remove some indent from the starting though, which I am not sure what are they really for.

@ykphuah ykphuah linked a pull request Dec 9, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant