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

data-diff first line bug #56

Closed
fry69 opened this issue Aug 21, 2023 · 0 comments · Fixed by #57
Closed

data-diff first line bug #56

fry69 opened this issue Aug 21, 2023 · 0 comments · Fixed by #57

Comments

@fry69
Copy link
Contributor

fry69 commented Aug 21, 2023

Regarding this bug: ember-learn/guides-source#1956

I traced this problem to this line: https://github.com/empress/ember-showdown-prism/blob/main/addon/initializers/showdown-extension.js#L89

The first line of the codeblock variable is already filled with rendered elements e.g. for the filename. Inserting the diff operator later into this first line will fail and produce bad HTML, see example below, the <span> for diff-operator + before the <span> for the filename:

URL: https://guides.emberjs.com/release/tutorial/part-2/service-injection/#toc_the-router-service

<section aria-labelledby="toc_the-router-service">
<p>To fix our problem, we would need to do the same. Ember exposes this internal state through the <em><a href="[https://api.emberjs.com/ember/release/classes/RouterService](view-source:https://api.emberjs.com/ember/release/classes/RouterService)">router service</a></em>, which we can <em><a href="[../../../services/#toc_accessing-services](view-source:https://guides.emberjs.com/release/services/#toc_accessing-services)">inject</a></em> into our component:</p>
<span class="diff-insertion"><span class="diff-operator">+</span><div class="filename js"><div class="ribbon"></div><span>app/components/share-button.js</span><pre class="language-js line-numbers"><code class="js language-js"><span class="token keyword">import</span> <span class="token punctuation">{</span> service <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@ember/service'</span><span class="token punctuation">;</span></span>
<span class="token keyword">import</span> Component <span class="token keyword">from</span> <span class="token string">'@glimmer/component'</span><span class="token punctuation">;</span>
Misplaced diff operator DOM view Misplaced diff operator Safari browser
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 a pull request may close this issue.

1 participant