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

Preserve nodes on code includes #2479

Open
tpluscode opened this issue Feb 26, 2023 · 6 comments
Open

Preserve nodes on code includes #2479

tpluscode opened this issue Feb 26, 2023 · 6 comments

Comments

@tpluscode
Copy link
Contributor

tpluscode commented Feb 26, 2023

Specifically, I wrap my code snippets with a Custom Element which presents them as tabs. It would look like this in code

<s2q-snippet>
  <pre class="include-code" slot="shape">
  path: example/values-focus-node.ttl
  highlight: turtle
  </pre>

  <pre class="include-code" slot="query">
  path: example/values-focus-node.ttl.rq
  highlight: sparql
  </pre>
</s2q-snippet>

The element s2q-snippet renders a two tabs and distributes the snippets in two slots, shape and query

Problem is, that the [slot] attributes are not preserved in the output if bikeshed.

-<pre class="include-code highlight" slot="shape">
+<pre class="include-code highlight">

I would expect any additional HTML attributes to be preserved as-is in the rendered HTML

@tabatkins
Copy link
Collaborator

Yeah, I should fix this. Right now I just generate a brand-new element holding the attributes I parsed from the contents, but merging into the existing element is definitely doable.

@tabatkins
Copy link
Collaborator

Okay, doing this was a larger project than I thought, but it was worthwhile! Should all be good, but lmk if you have any issues.

@tpluscode
Copy link
Contributor Author

Worked well for my use case. Thanks!

While I have your attention, could you merge #2093? I rebase and updated a number of times to sync with latest changes :)

@tabatkins
Copy link
Collaborator

Reopening because this is temporarily reverted while I bake the code more. See #1773 (comment) for details.

@tabatkins tabatkins reopened this Mar 23, 2023
@tpluscode
Copy link
Contributor Author

Hello. Any chance to revisit this?

@tabatkins
Copy link
Collaborator

Yup, the "temporary" revert is lasting longer than planned, but it should be finished this quarter.

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

No branches or pull requests

2 participants