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

JavaScript syntax number strings rendered with an offset #3791

Closed
andie2019 opened this issue Apr 18, 2024 · 2 comments
Closed

JavaScript syntax number strings rendered with an offset #3791

andie2019 opened this issue Apr 18, 2024 · 2 comments

Comments

@andie2019
Copy link

andie2019 commented Apr 18, 2024

Information:

  • Prism version: 1.29.0
  • Plugins: None
  • Environment: Browser, generated using MadCap Flare

Description
When using the JavaScript language syntax, number strings not specified inside quotation marks would be rendered off the codeblock, overlapping the left margin.

Snag_fdf629

In this example, the first two parameters should be rendered as:
"accountId": 12345,
"workspaceId": [
12345
],

Number strings render correctly when placed inside quotation marks, or when using a different syntax.

Under the section Search Response Attributes > Response:
The first response codeblock is rendered in JavaScript (number strings are offset to the left margin)
The second codeblock is rendered in another language (number strings placed correctly)

@FIameCaster
Copy link

There's a CSS selector in perforce.css that matches number tokens generated by Prism.

span.number
{
	float: left;
	margin-left: -24px;
	position: relative;
	font-family: 'Open Sans';
}

Change the selector to something like span.number:not(.token) and the problem is fixed.

@andie2019
Copy link
Author

andie2019 commented Apr 19, 2024

Thanks you FlameCaster, will try this!
Edit: All good now! Will close this ticket! Thanks again~~

@andie2019 andie2019 changed the title Java syntax number strings rendered with an offset JavaScript syntax number strings rendered with an offset Apr 19, 2024
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

No branches or pull requests

2 participants