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

fix: Properly handle anchor tags without href fields #230

Merged
merged 1 commit into from Jul 7, 2020

Conversation

peblair
Copy link
Contributor

@peblair peblair commented Jul 4, 2020

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This pull request updates the nuxt-content JSON parser to properly handle anchor tags which are missing an href attribute. Here is an example of a Markdown file which triggers the issue:

---
title: Repro
---
<a name="foo"></a>Hello, world

The problem is that this line crashes, since there is no href attribute. This pull request changes the behavior to gracefully handle situations like this.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

I did not add any tests, since I felt this was a very minor change. If a test is desired, I can add one.

@peblair peblair changed the title Properly handle anchor tags without href fields fix: Properly handle anchor tags without href fields Jul 4, 2020
@codecov-commenter
Copy link

@codecov-commenter codecov-commenter commented Jul 4, 2020

Codecov Report

No coverage uploaded for pull request base (dev@858bff9). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##             dev     #230   +/-   ##
======================================
  Coverage       ?   89.56%           
======================================
  Files          ?       15           
  Lines          ?      527           
  Branches       ?      107           
======================================
  Hits           ?      472           
  Misses         ?       48           
  Partials       ?        7           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 858bff9...f3b11cf. Read the comment docs.

Atinux
Atinux approved these changes Jul 6, 2020
@benjamincanac benjamincanac merged commit b8527a9 into nuxt:dev Jul 7, 2020
4 checks passed
benjamincanac added a commit that referenced this issue Jul 10, 2020
* docs: update github link to dev branch

* Properly handle anchor tags without href fields (#230)

* chore(deps): update dependency @nuxt/static to ^0.0.12 (#234)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update devdependency sass-loader to ^9.0.2 (#235)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: use compound sort (#238)

* fix(lib): use compound sort

* fix(lib): plugin sends sorts in wrong order

* test: add with multiple sorts

* chore(deps): update dependency @nuxt/static to v1 (#242)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore: add content:ready hook (#243)

* translate configuration.md into japanese

* add playground.md in ja

* add integrations.md in ja

* add examples.md in ja

* edit fetching.md

* translate wriging.md in ja

* update theme.md front matter in ja

* translate advanced.md in ja

* fix a bit

* edit front matter

* add translation

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: Philip E Blair <peblairman@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
benjamincanac added a commit that referenced this issue Jul 20, 2020
* docs: update github link to dev branch

* Properly handle anchor tags without href fields (#230)

* chore(deps): update dependency @nuxt/static to ^0.0.12 (#234)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update devdependency sass-loader to ^9.0.2 (#235)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: use compound sort (#238)

* fix(lib): use compound sort

* fix(lib): plugin sends sorts in wrong order

* test: add with multiple sorts

* chore(deps): update dependency @nuxt/static to v1 (#242)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore: add content:ready hook (#243)

* translate configuration.md into japanese

* add playground.md in ja

* add integrations.md in ja

* add examples.md in ja

* edit fetching.md

* translate wriging.md in ja

* update theme.md front matter in ja

* translate advanced.md in ja

* fix a bit

* edit front matter

* add translation

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: Philip E Blair <peblairman@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
benjamincanac added a commit that referenced this issue Jul 21, 2020
* docs: update github link to dev branch

* Properly handle anchor tags without href fields (#230)

* chore(deps): update dependency @nuxt/static to ^0.0.12 (#234)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update devdependency sass-loader to ^9.0.2 (#235)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: use compound sort (#238)

* fix(lib): use compound sort

* fix(lib): plugin sends sorts in wrong order

* test: add with multiple sorts

* chore(deps): update dependency @nuxt/static to v1 (#242)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore: add content:ready hook (#243)

* docs: Update Japanese translate (#245)

* docs: update github link to dev branch

* Properly handle anchor tags without href fields (#230)

* chore(deps): update dependency @nuxt/static to ^0.0.12 (#234)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update devdependency sass-loader to ^9.0.2 (#235)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: use compound sort (#238)

* fix(lib): use compound sort

* fix(lib): plugin sends sorts in wrong order

* test: add with multiple sorts

* chore(deps): update dependency @nuxt/static to v1 (#242)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore: add content:ready hook (#243)

* translate configuration.md into japanese

* add playground.md in ja

* add integrations.md in ja

* add examples.md in ja

* edit fetching.md

* translate wriging.md in ja

* update theme.md front matter in ja

* translate advanced.md in ja

* fix a bit

* edit front matter

* add translation

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: Philip E Blair <peblairman@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>

* add user defined parsers

* fix empty options

* add to default config

* add docs

* Update nuxt.config.js

* Create custom.custom

* Update nuxt.config.js

* Update index.md

* Update configuration.md

* Update nuxt.config.js

* Update utils.js

* Update database.js

* test: add options with extend parser

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: Philip E Blair <peblairman@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: 森 優太 mori <59682979+uta-mori@users.noreply.github.com>
benjamincanac added a commit that referenced this issue Jul 27, 2020
* docs: update github link to dev branch

* Properly handle anchor tags without href fields (#230)

* chore(deps): update dependency @nuxt/static to ^0.0.12 (#234)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update devdependency sass-loader to ^9.0.2 (#235)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: use compound sort (#238)

* fix(lib): use compound sort

* fix(lib): plugin sends sorts in wrong order

* test: add with multiple sorts

* chore(deps): update dependency @nuxt/static to v1 (#242)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore: add content:ready hook (#243)

* translate configuration.md into japanese

* add playground.md in ja

* add integrations.md in ja

* add examples.md in ja

* edit fetching.md

* translate wriging.md in ja

* update theme.md front matter in ja

* translate advanced.md in ja

* fix a bit

* edit front matter

* add translation

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: Philip E Blair <peblairman@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
benjamincanac added a commit that referenced this issue Jul 27, 2020
* docs: update github link to dev branch

* Properly handle anchor tags without href fields (#230)

* chore(deps): update dependency @nuxt/static to ^0.0.12 (#234)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update devdependency sass-loader to ^9.0.2 (#235)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: use compound sort (#238)

* fix(lib): use compound sort

* fix(lib): plugin sends sorts in wrong order

* test: add with multiple sorts

* chore(deps): update dependency @nuxt/static to v1 (#242)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore: add content:ready hook (#243)

* docs: Update Japanese translate (#245)

* docs: update github link to dev branch

* Properly handle anchor tags without href fields (#230)

* chore(deps): update dependency @nuxt/static to ^0.0.12 (#234)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update devdependency sass-loader to ^9.0.2 (#235)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: use compound sort (#238)

* fix(lib): use compound sort

* fix(lib): plugin sends sorts in wrong order

* test: add with multiple sorts

* chore(deps): update dependency @nuxt/static to v1 (#242)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore: add content:ready hook (#243)

* translate configuration.md into japanese

* add playground.md in ja

* add integrations.md in ja

* add examples.md in ja

* edit fetching.md

* translate wriging.md in ja

* update theme.md front matter in ja

* translate advanced.md in ja

* fix a bit

* edit front matter

* add translation

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: Philip E Blair <peblairman@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>

* add user defined parsers

* fix empty options

* add to default config

* add docs

* Update nuxt.config.js

* Create custom.custom

* Update nuxt.config.js

* Update index.md

* Update configuration.md

* Update nuxt.config.js

* Update utils.js

* Update database.js

* test: add options with extend parser

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: Philip E Blair <peblairman@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: 森 優太 mori <59682979+uta-mori@users.noreply.github.com>
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.

None yet

4 participants