Skip to content

Complex inline expressions aren’t parsed correctly #396

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

Closed
mbostock opened this issue Dec 17, 2023 · 0 comments · Fixed by #1416 or #1441
Closed

Complex inline expressions aren’t parsed correctly #396

mbostock opened this issue Dec 17, 2023 · 0 comments · Fixed by #1416 or #1441
Assignees
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

For example, this works fine:

${html`<div style="display: grid; grid-auto-rows: 1fr; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 1rem;">${await Promise.all(muybridge.filenames.map((f) => muybridge.file(f).image({style: "width: 100%;"})))}</div>`}

but this fails:

${html`<div style="display: grid; grid-auto-rows: 1fr; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 1rem;">
  ${await Promise.all(muybridge.filenames.map((f) => muybridge.file(f).image({style: "width: 100%;"})))}
</div>`}

Really, I want to do this:

<div style="display: grid; grid-auto-rows: 1fr; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 1rem;">
  ${Promise.all(muybridge.filenames.map((f) => muybridge.file(f).image({style: "width: 100%;"})))}
</div>

But I can’t do that because the wrapper spans interfere with the grid. #11

Overall, I think our current parser strategy is not very robust, and we probably want to pull inline expression parsing out of markdown-it and do it before (or after?) borrowing techniques from Hypertext Literal. Related #32.

@mbostock mbostock added the bug Something isn’t working label Dec 17, 2023
@cinxmo cinxmo added this to the Future milestone Jan 16, 2024
@mbostock mbostock removed this from the Future milestone Mar 24, 2024
@mbostock mbostock self-assigned this Jun 4, 2024
@mbostock mbostock reopened this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants