summaryrefslogtreecommitdiff
path: root/test/syntax_highlighter_test.rb
AgeCommit message (Collapse)Author
2023-02-21resolves #4406 fix test assertion for fallback Rouge stylesheet to be ↵Todd Zullinger
compatible with Rouge 4.1 (PR #4407) Co-authored-by: Dan Allen <dan.j.allen@gmail.com>
2022-10-18remove workarounds for JRuby 9.1 in test suiteDan Allen
2021-08-17resolves #4130 layout source with table-based linenums as table rows when ↵Dan Allen
using rouge as source highlighter (PR #4133)
2021-08-12resolves #3641 add support for inline linenums mode when using Rouge as ↵Dan Allen
source highlighter (PR #4129)
2021-08-08normalize output from Pygments to use linenos class for inline line ↵Dan Allen
numbering and trim space after number
2021-08-08remove unnamespaced selectors in Pygments stylesheetDan Allen
2021-08-08remove redundant indentation in heredoc strings in test suiteDan Allen
2021-04-30leave empty line after magic comment [skip ci]Dan Allen
2021-04-15resolves #3550 run tests on JRuby for Windows in CI (PR #3841)Dan Allen
* run tests on JRuby 9.1 and 9.2 for Windows in CI * don't run Pygments tests on JRuby 9.1 for Windows * exclude tests that use run_command on JRuby 9.1 for Windows * ensure mtime of input file honors TZ environment variable on JRuby for Windows
2021-03-24resolves #3969 add support for using pygments.rb 2.x when ↵Marat Radchenko
source-highlighter=pygments * allow pygments.rb 2.x to be used as alternative to pygments.rb 1.x and document this support * use a single regular expression to rewrite the lineno spans independent of Pygments version * run tests against pygments.rb 2.x in addition to pygments.rb 1.x * update docs about Pygments timeout to be clear it only applies to pygments.rb 1.x * update test description that checks for lineno spans
2021-01-22resolves #3916 upgrade rouge and fix test assertion (PR #3920)Dan Allen
2021-01-22remove stray wip in test suiteDan Allen
2020-11-09add if and unless conditions to tests to make filtering more readable (PR #3844)Dan Allen
- also define windows? as static method for these cases - don't match darwin when detecting Windows
2020-10-26resolves #3786 retain attribute order on HTML code tag for source block to ↵Dan Allen
remain consistent with output from 1.5.x (PR #3787)
2020-09-25resolves #3761 use custom init function for highlight.js to select correct ↵Dan Allen
code elements (PR #3762)
2020-07-17resolves #3503 move style tag for client-side syntax highlighers ↵Dan Allen
(highlight.js, prettify) into head (PR #3718)
2020-07-17resolves #3519 compute highlight line ranges on source block relative to ↵Guillaume Grossetie
value of start attribute (PR #3701)
2020-07-17resolves #3625 don't use module_function to define entry point methods in ↵Dan Allen
API (PR #3713) - define load, convert, load_file, convert_file as module methods (e.g., `def self.load`) - avoids conflict between `Asciidoctor.load` and `Kernel.load` when calling `include Asciidoctor` - add test that Rouge integration works in combination with `include Asciidoctor`
2019-12-26reenable pygments testsDan Allen
- check for correct environment variable
2019-12-13optimize method that resolves lines to highlight and add additional test casesDan Allen
2019-10-23resolves #3462 move style tag for convert-time syntax highlighters into head ↵Dan Allen
(PR #3463) - move style tag for convert-time syntax highlighters into head - invoke docinfo? :head method on syntax highlighter adapter after content has been converted
2019-06-21resolves #3319 preserve guard around XML-style callout when icons are ↵Dan Allen
disabled (PR #3343)
2019-06-15resolves #3336 fix how options are passed to the Rouge lexer (PR #3339)Dan Allen
* restore compatibility with Rouge >= 3.4 * eagerly instantiate lexer if not using find_fancy * pass options to constructor of Rouge lexer instead of #lex method * don't clobber cgi-style options on language when enabling start_inline option on the Rouge PHP lexer * add tests for passing options to the Rouge lexer * upgrade Rouge to 3.4.0 (for development); also test against Rouge 2.0.7 in CI
2019-04-22resolves #3274 update register_for methods to accept symbol arguments (PR #3275)Dan Allen
- coerce symbol arguments to register_for to strings - fill in missing API doc for register_for and register methods in SyntaxHighlighter module
2019-04-01make Asciidoctor::SyntaxHighlighter::Config.register_for method public as ↵Dan Allen
documented
2019-03-31resolves #3223 should not crash when source highlighter is rouge and source ↵Dan Allen
language is not set on block (PR #3224)
2019-03-18resolves #3036 load additional languages for highlight.js as defined in the ↵Dan Allen
highlightjs-languages attribute (PR #3159)
2019-03-18make highlight.js test more robustDan Allen
2019-03-09resolves #3137 fallback to text scanner when highlighting with CodeRay if ↵Dan Allen
source lang is invalid (PR #3138)
2019-02-15clean up newline handling in test suite (PR #3074)Dan Allen
- use chop instead of chomp to remove trailing newline from heredoc string - document all uses of non-quoted squiggly heredoc to preserve indentation - fix incorrect preparation of uniform indentation in list tests - remove unnecessary uses of chomp
2019-02-10add test to verify start line number is set to 1 by defaultDan Allen
2019-02-10resolves #3054 never mutate strings; add `frozen_string_literal: true` ↵Dan Allen
comment to source files (PR #3055) - replace gsub! and sub! with gsub and sub, respectively - add `frozen_string_literal: true` magic comment to all Ruby source files - see https://www.mikeperham.com/2018/02/28/ruby-optimization-with-one-magic-comment/
2019-02-03expose style methods as static methods on rouge syntax highlighter adapterDan Allen
2019-02-03group syntax highlighter tests into context per syntax highlighterDan Allen
2019-02-03resolves #1040 add syntax highlighter adapter for Rouge (PR #3033)Dan Allen
- add SyntaxHighlighter adapter implementation for Rouge - support CGI options attached to language (e.g., "console?prompt=$ ") - change CSS class of line numbering table for Pygments and Rouge to linenotable - reuse styles from default stylesheet to layout the line number column - remove nested pre wrapper in Pygments output when line numbering is enabled and linenums mode is inline - ensure syntax highlighter library is loaded when looking up base style - add the rouge gem as a development dependency
2019-01-30Switch to squiggly heredoc in test suite & CLI (PR #3035)Dan Allen
* use squiggly heredoc in syntax highlighter tests to make them more readable * use squiggly heredoc to define CLI banner
2019-01-26ensure linenos class is always added to linenos column when source ↵Dan Allen
highlighter is pygments
2019-01-26resolves #2106 make syntax highlighter pluggable (PR #3016)Dan Allen
- define the Asciidoctor::SyntaxHighlighter module to handle all aspects of syntax highlighting - define built-in SyntaxHighlighter adapters for coderay, pygments, highlight.js, html-pipeline, and prettify - move all embedded syntax highlighting logic into SyntaxHighlighter adapters - allow SyntaxHighlighter adapter class to self register with a source highlighter name using register_for - load SyntaxHighlighter adapters lazily (except for highlight.js and html-pipeline) - add :syntax_highlighters and :syntax_highlighter_factory options to API to allow syntax highlighter resolution to be customized - instantiate SyntaxHighlighter adapter once header is finalized if source-highlighter attribute is set on document and basebackend is html - provide SyntaxHighlighter factory modules for registering syntax highlighter adapters (default, custom, and default proxy) - allow SyntaxHighlighter adapters to contribute docinfo at :head and :footer slots in HTML output document - move retrieval and writing of stylesheets for syntax highlighters to SyntaxHighlighter adapters - wire methods in Stylesheets class that pertain to syntax highlighting to SyntaxHighlighter adapters - remove hard-coded styles in Pygments output - update default stylesheets to support Pygments styles and drop CSS workarounds - don't fail if value of pygments-style attribute is not recognized; instead fallback to default style - don't remove nested pre tags in HTML produced by Pygments when linenums are enabled - update default stylesheet to avoid styling nested pre tags - rename pygments table class to pygments-table - change pygments base CSS selector from .listingblock .pygments to pre.pygments - allow color for generic text, line numbers, and line number border to inherit from Pygments style - align stylesheet for default CodeRay style with other syntax highlighters - set default background color for prettify using a selector with the lowest precedence - update and add tests - add tests for the Pygments integration - add pygments.rb dependency and enable Pygments integration tests if the environment variable PYGMENTS=true is set - move syntax highlighter tests to dedicated test file