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

Add Python triple-quoted strings "known failure" #1449

Merged
merged 2 commits into from
Jun 26, 2018

Conversation

brandon-rhodes
Copy link
Contributor

Documenting a failure that several of our users have run into,
since I’m not sure at first glance how to repair prism.js’s
Python rules without maybe breaking normal strings.

@brandon-rhodes
Copy link
Contributor Author

Let me know if there's a better way to get this documented for Python users of your library — or if there's a quick fix that I wasn't yet able to see from the examples.

Copy link
Member

@mAAdhaTTah mAAdhaTTah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. If you make the one minor change, I'll merge as-is. Regex isn't my strong suit so I'm not sure how difficult a fix would be, but we've got a couple of string-like substring-type problems, so I'm not surprised to see it pop up here too.


<h3>Triple-quoted strings with what look like strings inside</h3>
<pre><code>def antique(string):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre needs the language-python class.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for getting there so late! Actually it does not. Examples files are included dynamically, and they are all wrapped in a <div class="language-XXX"> element, using the language the example is for. (See https://github.com/PrismJS/prism/blob/master/examples.js#L69-L73)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I caught that, see my comment below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. I stopped reading at your "Thanks!" comment. x) Please ignore me.

@brandon-rhodes
Copy link
Contributor Author

There, I added it. Thanks!

@mAAdhaTTah mAAdhaTTah merged commit 334c7bc into PrismJS:master Jun 26, 2018
@mAAdhaTTah
Copy link
Member

Thanks!

@brandon-rhodes
Copy link
Contributor Author

(By the way — none of the other <pre> tags in that file have the Python language specified, in case that's something you need to fix up later.)

@brandon-rhodes brandon-rhodes deleted the python-known-failure branch June 26, 2018 15:23
@mAAdhaTTah
Copy link
Member

mAAdhaTTah commented Jun 26, 2018

Now that I'm looking closely, it turns out the class wasn't needed because of the way the examples page works. It injects your HTML page in a section tag with the correct class, and Prism inherits from that. I removed it on master for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants