-
Notifications
You must be signed in to change notification settings - Fork 120
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
no wrapper span #1416
no wrapper span #1416
Conversation
I don’t have a great way of automating tests for this functionality, but here are some of the new things you can do: <div class="flexy">
${d3.range(10).map((i) => html`<div>${i}</div>`)}
</div>
<style type="text/css">
.flexy {
display: flex;
}
.flexy > * {
flex-grow: 1;
}
</style> <table>
<thead>
<tr>
<td>i</td>
<td>one</td>
<td>two</td>
</tr>
</thead>
<tbody>
${d3.range(10).map((i) => html`<tr>
<td>${i}</td>
<td>one</td>
<td>two</td>
</tr>`)}
</tbody>
</table> <h2>hello</h2> editme <svg width=640 height=120 fill=red>
<text x=20 y=20>${now}</text>
</svg> <svg width=640 height=120>
${d3.range(10).map((i) => svg`<text x=${20 + i * 10} y=20 fill=${d3.interpolateTurbo(i / 10)}>${i}</text>`)}
</svg> |
(erroneous comment deleted) Nice! I wonder if this could help fix #375: now a comment with inline code |
Fixing that requires fundamental changes to our parser as described in #597. I don’t think we should tie these two things together. Interpolating within comments is broken and will remain broken in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK that was my only comment :)
Co-authored-by: Philippe Rivière <[email protected]>
Rather than producing an inline span,
inline expressions now produce a special comment:
<!--:6212702c:-->
This comment does not serve as a container for any rendered content but rather serves as a marker: rendered content (calls to
display
) are inserted before the comment. The rendered contents are tracked in the_nodes
array and removed as needed (rather than clearing the container viainnerHTML
).This eliminates the need for a wrapper span for inline expressions, which means things like this now work:
This also fixes rendering inline expressions into SVG and some edge cases with incremental update during preview.
Fixes #11.
Fixes #1414.
Fixes #1415.
Adding in #1425:
Fixes #375.
Fixes #396.
Fixes #597.
Fixes #636.