Skip to content

Conversation

@ylluminarious
Copy link

<code> loses spacing from pre-evaluated text (like from a binding).
Here is an answer on StackOverflow going into more detail about this: http://stackoverflow.com/a/16065718/2636454

@ylluminarious
Copy link
Author

@ryanstout I've added some commits on my fork, so merging this PR should bring the changes in. I can remove the <pre> tag change if you'd like.

@ryanstout
Copy link
Member

So maybe I didn't explain things right. I want content bindings to take in a string and correctly put that string on the screen. So something like this: {{ "some\n\nstring" }} should be rendered as some<br /><br />string Moving it into pre means that thats going to show the
's when you use a binding. Maybe we need it where if you want to have it preformatted, you could pass in an option, then it would render based on that.

Thoughts?

@ylluminarious
Copy link
Author

@ryanstout Have you tested this out? I just tried using a string in a binding, within a <pre> tag like so:

<!-- This is using my fork, so <:code_highlight> translates to <pre> -->
<:code_highlight language="ruby">{{ "some\n\nstring" }}</:code_highlight> 

And upon looking at the element in the inspector, it rendered like so:

<pre id="id10008" class="ruby hljs">
  some
  <br>
  <br>
  string
</pre>

Maybe I'm misunderstanding what you mean, though.

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

Successfully merging this pull request may close these issues.

2 participants