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

Checkboxes disappear on empty line #315

Open
kokoISnoTarget opened this issue Apr 13, 2024 · 2 comments
Open

Checkboxes disappear on empty line #315

kokoISnoTarget opened this issue Apr 13, 2024 · 2 comments
Labels
A-interpreter Area: Changes impacting the HTML interpreter C-bug Category: Something isn't working

Comments

@kokoISnoTarget
Copy link
Contributor

- [ ] Some option
 
- [x] Wow, the checks disappear

Appears like this in 4.2:
Screenshot_2024-04-13-19-39-25_5120x1263

@CosmicHorrorDev CosmicHorrorDev added the C-bug Category: Something isn't working label Apr 13, 2024
@CosmicHorrorDev
Copy link
Collaborator

CosmicHorrorDev commented Apr 13, 2024

Can reproduce on main 👍

Looks like it's probably a bug in the interpreter, since adding that text as an interpreter test gets this

Snapshot: interpreter__tests__checklist_with_gap
Source: src/interpreter/tests.rs:374
─────────────────────────────────────────────────────────────────────────────────
Expression: interpret_md_with_opts(text, opts)
─────────────────────────────────────────────────────────────────────────────────
 --- md

- [ ] Some option

- [x] Wow, the checks disappear


 --- html

<ul>
<li><input type="checkbox" disabled="" />
<p>Some option</p>
</li>
<li><input type="checkbox" checked="" disabled="" />
<p>Wow, the checks disappear</p>
</li>
</ul>

─────────────────────────────────────────────────────────────────────────────────
Snapshot Contents:
──────┬──────────────────────────────────────────────────────────────────────────
    1 │ [
    2 │     TextBox(
    3 │         TextBox {
    4 │             indent: 50.0,
    5 │             texts: [
    6 │                 Text {
    7 │                     text: "Some option",
    8 │                     default_color: Color(BLACK),
    9 │                     ..
   10 │                 },
   11 │             ],
   12 │             ..
   13 │         },
   14 │     ),
   15 │     Spacer(
   16 │         InvisibleSpacer(5),
   17 │     ),
   18 │     TextBox(
   19 │         TextBox {
   20 │             indent: 50.0,
   21 │             texts: [
   22 │                 Text {
   23 │                     text: "Wow, the checks disappear",
   24 │                     default_color: Color(BLACK),
   25 │                     ..
   26 │                 },
   27 │             ],
   28 │             ..
   29 │         },
   30 │     ),
   31 │     Spacer(
   32 │         InvisibleSpacer(5),
   33 │     ),
   34 │     Spacer(
   35 │         InvisibleSpacer(5),
   36 │     ),
   37 │ ]
──────┴──────────────────────────────────────────────────────────────────────────

So the HTML shows that it considers it to be one list with two checkboxes, but the interpreter returns it as two indented text boxes instead of having a checkbox prefix

@CosmicHorrorDev CosmicHorrorDev added the A-interpreter Area: Changes impacting the HTML interpreter label Apr 14, 2024
@kokoISnoTarget
Copy link
Contributor Author

kokoISnoTarget commented Apr 14, 2024

It looks like that an li cant contain anything else than bare text

- [ ] Some text
- [ ] <h1>Test</h1>
- [ ] <p>Test</p>
- [ ] <img src="example.png">

Screenshot_2024-04-14-12-42-05_5120x1263

And the newline adds an p tag in the HTML

kokoISnoTarget added a commit to kokoISnoTarget/inlyne that referenced this issue Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interpreter Area: Changes impacting the HTML interpreter C-bug Category: Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants