PrismJS / PrismJS/prism

Test runner output differs from real output

Open
#3,559 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Information:

  • Prism version: 1.29.0

Description
I am trying to add support for Adventure Game Studio script syntax and have the highlighter working, but I am unable to add tests because the test runner token stream appears to be different to the real token stream.

Example
Build the fork at https://github.com/adventuregamestudio/prism/tree/ags as normal (the only changes in the fork are the addition of two languages).

Using the language "agsdialog" with this content:

@S
@1

...will produce this output within the test page:

<span class="token line"><span class="token dialog-index variable">@S</span></span>
<span class="token line"><span class="token dialog-index variable">@1</span></span>

Using the following HTML based test through the test runner:

@S
@1

----------------------------------------------------

<span class="token line"><span class="token dialog-index variable">@S</span></span>
<span class="token line"><span class="token dialog-index variable">@1</span></span>

----------------------------------------------------

Dialog indices.

...will produce this output from the test:

<span class="token line"><span class="token dialog-index variable">@S</span></span>
<span class="token line"></span>
<span class="token line"></span>
<span class="token line"></span>
<span class="token line"></span>
<span class="token line"></span>
@1

To be very clear, I am only seeing problems within the test runner. Outside of the test runner the tokens and output are as expected, and this is visually confirmed on the test page:
token_highlighting

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the mismatch in the test runner using the agsdialog language and the @S/@1 input, then compare it with the output shown on the test page. Trace how the runner parses the HTML-based expected output; done means both tokens are preserved and the runner output matches the real highlighted output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.