Skip to content

How do I correctly apply a span in the middle of another tag? #215

Answered by mhanberg
sylvesterroos asked this question in Q&A
Discussion options

You must be logged in to vote

so in temple it just isn't possible (currently) for it to emit the code that you're looking for

a work around in this case is something like

<p>
  Hello
  <span style="display: inline-flex;">
    <span style="text-decoration: line-through;">world</span>
    <span>world</span>
  </span>
</p>

in temple syntax this is

p do
  "Hello"

  span style: "display: inline-flex" do
    span style: "text-decoration: line-through;", do: "world"
    span do: "world"
  end

  "world"
end

the main problem here I think is intuitively you want to interpolate the original span into the string, but that isn't supported currently.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@mhanberg
Comment options

@sylvesterroos
Comment options

@sylvesterroos
Comment options

@mhanberg
Comment options

Answer selected by sylvesterroos
@sylvesterroos
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants