Skip to content

fix: prevent double-prefix in docsUrl by handling absolute URLs#33

Open
damitha-canva wants to merge 2 commits intolottie:mainfrom
damitha-canva:fix-validator-url
Open

fix: prevent double-prefix in docsUrl by handling absolute URLs#33
damitha-canva wants to merge 2 commits intolottie:mainfrom
damitha-canva:fix-validator-url

Conversation

@damitha-canva
Copy link
Copy Markdown

Ensure that documentation links use the base docs_url only for relative paths. Absolute URLs are now passed through unchanged, avoiding malformed URLs like:

https://lottie.github.io/lottie-spec/latest/https://…

Ensure that documentation links use the base docs_url only for relative paths. Absolute URLs are now passed through unchanged, avoiding malformed URLs like:

https://lottie.github.io/lottie-spec/latest/https://…
@mbasaglia
Copy link
Copy Markdown
Member

Maybe it's better to fix the root cause than the symptom, where have you encountered this?

@damitha-canva
Copy link
Copy Markdown
Author

Coming from

https://lottie.github.io/validator/

Text =>

{"c":"k"}

url comes as https://lottie.github.io/lottie-spec/latest/https://lottie.github.io/lottie-spec/latest/specs/composition/#animation

I think it is reading the default_config from https://github.com/lottie/lottie-specs-js/blob/aab6b9fa491bc04c0790445864a920a0c1ca1faf/src/validator.js#L276

@mbasaglia
Copy link
Copy Markdown
Member

The repo for that would be this: https://github.com/lottie/lottie-specs-js

But there too I think we should fix the core problem rather then matching the url

@damitha-canva
Copy link
Copy Markdown
Author

Not sure what is the problem in lottie-spec-js though, I assume users want to use the docs_url when they use LottieValidator independently. I have made a commit to override the default_config in LottieValidator when used in this repo.

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.

2 participants