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

refactor(parser): do not parse for links if not needed #463

Merged

Conversation

xcoulon
Copy link
Member

@xcoulon xcoulon commented Jan 3, 2020

only parse for inline links if a document attribute
subsitution occurred

also, update the grammar for inline links to parse
until the EOF

Fixes #462

Signed-off-by: Xavier Coulon [email protected]

only parse for inline links if a document attribute
subsitution occurred

also, update the grammar for inline links to parse
until the EOF

Fixes bytesparadise#462

Signed-off-by: Xavier Coulon <[email protected]>
@@ -10,102 +10,111 @@ import (

// applyDocumentAttributeSubstitutions(elements applies the document attribute substitutions
// and re-parse the paragraphs that were affected
func applyDocumentAttributeSubstitutions(element interface{}, attrs types.DocumentAttributes) (interface{}, error) {
func applyDocumentAttributeSubstitutions(element interface{}, attrs types.DocumentAttributes) (interface{}, bool, error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cyclomatic complexity 32 of func applyDocumentAttributeSubstitutions is high (> 30) (from gocyclo)

Signed-off-by: Xavier Coulon <[email protected]>
@codecov
Copy link

codecov bot commented Jan 3, 2020

Codecov Report

Merging #463 into master will increase coverage by 0.02%.
The diff coverage is 80%.

@@            Coverage Diff             @@
##           master     #463      +/-   ##
==========================================
+ Coverage   88.56%   88.58%   +0.02%     
==========================================
  Files          63       63              
  Lines        4057     4066       +9     
==========================================
+ Hits         3593     3602       +9     
  Misses        301      301              
  Partials      163      163

@xcoulon xcoulon merged commit 4b9cc03 into bytesparadise:master Jan 3, 2020
@xcoulon xcoulon deleted the Issue462_do_not_parse_if_not_needed branch August 3, 2020 12:29
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.

Do not parse for links if no substitution occurred
2 participants