Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upIncorrect syntax highlighting #32
Comments
This comment has been minimized.
This comment has been minimized.
|
Can you attach the HTML output file? I'll wager it's the highlighting engine auto-detecting the wrong language. |
This comment has been minimized.
This comment has been minimized.
|
here is the link to the html: https://www.dropbox.com/s/p1qoke0ko0xcy1l/constraintanalysis.html?dl=0
|
pdoc3
deleted a comment from
sobester
Feb 15, 2019
This comment has been minimized.
This comment has been minimized.
|
The issue appears to be that Highlight.js for some reason recognizes your code snippet as Makefile code. You can force the code language using fenced-code blocks with language specification instead of indented blocks, i.e.: EXAMPLE
-------
```python
import constraintanalysis as ca
import atmospheres as at
import unitconversions as co
...
```Other than that, this looks like an upstream issue. Filed as highlightjs/highlight.js#1976. |
kernc
added
the
upstream
label
Feb 17, 2019
This comment has been minimized.
This comment has been minimized.
|
The fence code blocks method seems to do the trick! Many thanks. |
kernc
changed the title
Help needed with syntax highlighting - what am I doing wrong?
Incorrect syntax highlighting
Apr 22, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sobester commentedFeb 14, 2019
•
edited by kernc
Expected Behavior
Syntax highlighting in code snipets in docstring
Actual Behavior
Syntax highlighted beautifully in some cases, partially in others (only some keywords, etc.), not at all in yet others.
Steps to Reproduce
Here is an example function where the resulting HTML has the code all in grey:
Other, seemingly very similar docstrings in the same .py file are highlighted very nicely, for example:
I cannot figure what I'm doing right in one but not in the other...
Many thanks for the great tool.
Additional info