Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

support json #89

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

theskillwithin
Copy link

@theskillwithin theskillwithin commented Oct 20, 2024

Description

#88

Support json. if file extension is set to json then parse json instead of md

Fixes # (issue number)

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Information

Include any additional information about the pull request here.

@gaurav-nelson
Copy link
Contributor

gaurav-nelson commented Oct 20, 2024

Thank you @theskillwithin for the PR.

  1. The current test doesn't really check the code you've added. Can you update the test to check links in a json file? PS: https://github.com/UmbrellaDocs/linkspector/pull/70/files Create a configuration file, and a json file to test and then run linkspector.
  2. Updating the README would make this ✨ PR shine as well.

* @returns {Array} The updated link status. Each status is an object with properties `link`, `status`, `status_code`, `line_number`, `position`, `error_message`, `title`, and `children`.
* The returned array is sorted by line number and start column in ascending order.
*/
'use strict'

function updateLinkStatusObj(astNodes, linkStatus) {
function updateLinkStatusObj(astNodes, linkStatus, config) {
const isJsonFile =
Copy link
Author

Choose a reason for hiding this comment

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

actually more ideally this wouldn't use the config for this. it should instead be determined per each file

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants