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

Feature/sync kramdown 1.17 #3

Closed
wants to merge 0 commits into from

Conversation

digitalmoksha
Copy link
Owner

Sync up with kramdown 1.17.

@digitalmoksha
Copy link
Owner Author

Part of the upgrade 1.17 involves some of the regular expressions using named capture blocks. For example

      ATX_HEADER_START = /^(?<level>\#{1,6})[\t ]*(?<contents>[^ \t].*)\n/

in lib/kramdown/parser/kramdown/header.rb. This leads to spec failures like this

TypeError: Bad argument "contents"
	/Users/me/.rvm/gems/ruby-2.5.3@rubymotion/gems/motion-strscan-0.5.1/lib/motion-strscan/strscan.rb:624:in `[]:': text-to-kramdown-to-html conversion - /Users/me/dev/_github/digitalmoksha/rubymotion/motion-kramdown/spec/motion-kramdown/_helpers/../../../test/testcases/block/04_header/with_auto_id_prefix.text --> kramdown --> html
	lib/kramdown/parser/kramdown/header.rb:48:in `parse_header_contents'
	lib/kramdown/parser/kramdown/header.rb:34:in `parse_atx_header'
	lib/kramdown/parser/kramdown.rb:146:in `block in parse_blocks:'
	lib/kramdown/parser/kramdown.rb:144:in `parse_blocks:'
	lib/kramdown/parser/kramdown.rb:89:in `parse'
	lib/kramdown/parser/base.rb:69:in `parse:'
	lib/kramdown/document.rb:104:in `initialize:'
	spec/motion-kramdown/text_to_kramdown_to_html.rb:50:in `<main>'

Will probably need to enhance motion-strscan to provide the support. But it's not clear the best way to do this yet.

Note that ICU does in fact support named captures: http://userguide.icu-project.org/strings/regexp though it's not clear if the macOS version does.

@digitalmoksha digitalmoksha self-assigned this Jun 20, 2020
@digitalmoksha digitalmoksha linked an issue Jun 20, 2020 that may be closed by this pull request
@digitalmoksha digitalmoksha force-pushed the feature/sync_kramdown_1.17 branch from 8d468ae to 4ded120 Compare July 5, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to kramdown 1.17.0
1 participant