-
Notifications
You must be signed in to change notification settings - Fork 4
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 Prism JS for syntax highlighting #32
Conversation
73887b0
to
8f9394c
Compare
This wikitext
|
So
Yes, nice to drop 7.4
Is that the same parameter name as used by the MW extension? I'm also a bit concerned about adding code specific parameters |
Yes. That's basically this TODO in the code: https://github.com/ProfessionalWiki/ExternalContent/pull/32/files#diff-4e52f3cf52e1f852c9ae649d8efeef9f7c7953d4ef619a21b4c1bdb93b2d0d15R30 It's simple enough to just check if the extension is not
Yes: https://www.mediawiki.org/wiki/Extension:SyntaxHighlight#line. That extension uses
I couldn't come up with a better approach. Unless we split the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that it'd be good to change ContentRendererFactory
to something like DelegatingContentRenderer
. The extractOptions
would go to EmbedFunction and BitBucketFuncrtion.
To properly dispatch on file extension, the URL normalization must happen first. Right now the ContentRendererFactory code is executed before the URL is normalized.
Epistemic status: 3 awake braincells
Getting behavior that is consistent, convenient, and reasonably in line with existing 1.x behavior seems challenging. Too difficult without sleep first. |
I'll do a follow-up with code improvements. |
Refs #30
lang
: the language name (https://prismjs.com/#supported-languages)line
: whether to show line numberslang
is specified then the code syntax highlighter is usedFollow-up TODOs:
Nice to have TODOs:
lang
is not specified)copy
parameter likeline
.