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

Non-deterministic rendering in fast renderer #51

Open
kabiroberai opened this issue Jun 21, 2018 · 1 comment
Open

Non-deterministic rendering in fast renderer #51

kabiroberai opened this issue Jun 21, 2018 · 1 comment
Labels

Comments

@kabiroberai
Copy link
Contributor

When rendering nested classes, the fast renderer determines which style takes precedence in a non-deterministic manner.

Eg.
xcode.css has the following definitions (simplified here for the sake of brevity):

.hljs-title {
  color: blue;
}

.hljs-class .hljs-title {
  color: purple;
}

The following JS snippet

class Foo

is converted to

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span></span>

In the aforementioned snippet, Foo should turn purple, however in reality the renderer randomly picks between blue and purple, and the color it picks varies between app launches.

@raspu
Copy link
Owner

raspu commented Jul 1, 2018

Seriously? That's a really interesting issue! I will take a look at it when I find some time.

@raspu raspu added the bug label Aug 8, 2018
sarunw added a commit to sarunw/Highlightr that referenced this issue Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants