-
Notifications
You must be signed in to change notification settings - Fork 234
Syntax highlighter cleanup #1352
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
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
be338ed
don't allow classes to be passed through on pod html
haarg d4a64fb
icons for source view
haarg 2365aaf
move syntax highlighter code to separate file
haarg 06caa48
use long filetype names for syntax brushes
haarg 5e88468
improve module regex in syntax highlighter
haarg 124d73c
initialize syntax highlighter with real classes and data attributes
haarg dd8dcc6
use normal pre styles for syntax highlighter
haarg faac8b4
hide/show pod by class toggle
haarg 718f00c
provide pod lines via data attribute rather than javascript
haarg 59d0329
add line numbers after highlighting rather than monkey patching
haarg 9f78c09
use hide/show labels for pod toggle
haarg d2d1fd5
allow highlighting multiple lines
haarg d25f102
only link line numbers on source page
haarg f37119d
scroll to highlighted element for ranges too
haarg 8911ac1
auto-hide pod via class attribute
haarg cfbcdfe
re-highlight rows when location hash changes
haarg b6dc99c
don't scroll when clicking on line numbers
haarg 7ac339e
allow syntax highlighter config through HTML filter
haarg 34bbf5a
move duplicate regex into variable
haarg cfba3bf
prevent syntax highlighter from stripping leading tabs as well
haarg b5cd942
simplify and reduce duplication in syntax highlighter code
haarg d3d4d21
more comments in syntax highlighter code
haarg 6746cd7
tidy pod html filter config
haarg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,7 +109,7 @@ sub view : Private { | |
br => [], | ||
caption => [], | ||
center => [], | ||
code => [], | ||
code => [ { class => qr/^language-\S+$/ } ], | ||
dd => ['id'], | ||
div => [qw(id style)], | ||
dl => ['id'], | ||
|
@@ -125,18 +125,25 @@ sub view : Private { | |
img => [qw( alt border height width src style title / )], | ||
li => ['id'], | ||
ol => [], | ||
p => [qw(class style)], | ||
pre => [qw(id class style)], | ||
span => [qw(style)], | ||
strong => [], | ||
sub => [], | ||
sup => [], | ||
table => [qw( style class border cellspacing cellpadding align )], | ||
tbody => [], | ||
td => [qw(style class)], | ||
tr => [qw(style class)], | ||
u => [], | ||
ul => ['id'], | ||
p => [qw(style)], | ||
pre => [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you comment on where these data attributes come from and/or what they mean? |
||
qw(id style), | ||
{ | ||
class => qr/^line-numbers$/, | ||
'data-line' => qr/^\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*$/, | ||
'data-start' => qr/^\d+$/, | ||
} | ||
], | ||
span => [qw(style)], | ||
strong => [], | ||
sub => [], | ||
sup => [], | ||
table => [qw( style border cellspacing cellpadding align )], | ||
tbody => [], | ||
td => [qw(style)], | ||
tr => [qw(style)], | ||
u => [], | ||
ul => ['id'], | ||
} | ||
); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you comment on what values might be coming through this attribute and from where?
I don't see why we should allow the
class
attribute to come through from pod for any tag.