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

The ()s in the url's image cause error with Dendron's extended image parser #2564

Closed
2 of 7 tasks
andrey-jef opened this issue Mar 14, 2022 · 7 comments
Closed
2 of 7 tasks
Assignees
Labels
scope.publish Static site generation, sending note links and anything to do with publishing your notes. scope.views Related to Preview, TreeView, UI Panels, and other webviews status.info-needed More information is needed from filer for issue to be actionable type.bug Something isn't working

Comments

@andrey-jef
Copy link

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

  • Workspace. VSCode workspace, vaults, Intellisense/autocomplete, Dendron settings
  • Lookup. Dendron's Lookup Command
  • Views. Dendron Preview, Tree View, Side Panels in the UI
  • Schema. Dendron Schemas
  • Pod. Data import from / export to Dendron
  • Publish. External Site Publish
  • Markdown. Markdown features, such as syntax support and features

Describe the bug

When appending the css properties to an image, instead of applying the properties, Dendron shows the css text next to image. This error happens only with a specific url.

To Reproduce

Steps to reproduce the behavior:

  1. Create a markdown note with embedded image url
Example
![example-current-liabilities](https://www.investopedia.com/thmb/aEVczlh4Rlnoc7CD-tyvgOKJW0g=/660x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/dotdash_Final_Current_Liabilities_Sep_2020-01-6515e265cfd34787ae2b0a30e9f1ccc8.jpg){max-width: 300px, display: block, margin: 0 auto}
  • image url:
    https://www.investopedia.com/thmb/aEVczlh4Rlnoc7CD-tyvgOKJW0g=/660x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/dotdash_Final_Current_Liabilities_Sep_2020-01-6515e265cfd34787ae2b0a30e9f1ccc8.jpg
  • appended css properties:
    {max-width: 300px, display: block, margin: 0 auto}
  1. Open Dendron Preview to show the note

Expected behavior

The css properties should be applied to image display.

Screenshots

Screenshot 2022-03-14 023815

Desktop (please complete the following information)

  • OS: Win 10
  • Browser (if with published websites; include version): Opera, Version:84.0.4316.31
  • Versions (all that apply to bug):
    • Dendron Extension: v0.85.0
    • VS Code version: VS Codium v1.65.2
    • Dendron CLI:

Additional context

comment from SeriousBug in discord: the ()s in the url must be throwing off our extended image parser, so it falls back to the default parser which doesn't have the extended properties

@github-actions github-actions bot added scope.publish Static site generation, sending note links and anything to do with publishing your notes. scope.views Related to Preview, TreeView, UI Panels, and other webviews status.triage-needed type.bug Something isn't working labels Mar 14, 2022
@SeriousBug SeriousBug self-assigned this Mar 14, 2022
@Harshita-mindfire
Copy link
Contributor

Thanks for reporting the bug. We will let you know when this is fixed 🙏

@SeriousBug
Copy link
Contributor

Hi! Thanks for the report, we have a fix coming which should be out soon.

In the meantime, I realized you can encode the parenthesis to make this work, by replacing ( with %28 and ) with %29. For example,

![alt](https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Pescatorea_%28Plate_XXIII%29_BHL36081367.jpg/411px-Pescatorea_%28Plate_XXIII%29_BHL36081367.jpg){ width: "300px" }

If you go to that link, you'll see that the original URL has ( and ) characters in it. The image will show up in the preview.

@andrey-jef
Copy link
Author

Hi! Thanks for the report, we have a fix coming which should be out soon.

In the meantime, I realized you can encode the parenthesis to make this work, by replacing ( with %28 and ) with %29. For example,

![alt](https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Pescatorea_%28Plate_XXIII%29_BHL36081367.jpg/411px-Pescatorea_%28Plate_XXIII%29_BHL36081367.jpg){ width: "300px" }

If you go to that link, you'll see that the original URL has ( and ) characters in it. The image will show up in the preview.

As u saw in my screenshot, the image can be displayed (but without css properties being applied) in the preview and published page. The problem is that the text of css properties will be appended next to the image.

Thanks for the workaround. It works as expected

@SeriousBug
Copy link
Contributor

This has been fixed in Dendron 0.88. Could you please try it after updating?

@SeriousBug SeriousBug added the status.info-needed More information is needed from filer for issue to be actionable label Mar 30, 2022
@andrey-jef
Copy link
Author

This has been fixed in Dendron 0.88. Could you please try it after updating?

hmm, just recheck with dendron updated to v0.88.0. The problem still persisted, in both Preview and published page, as shown in the screencap below. Or do I need to modify anything?

in published page

Screenshot 2022-03-30 121441

in Preview

Screenshot 2022-03-30 121408

@no-response no-response bot removed the status.info-needed More information is needed from filer for issue to be actionable label Mar 30, 2022
@SeriousBug
Copy link
Contributor

Ah, I think our release notes were incorrect on this. My bad, looks like it will be fixed in the next version.

@SeriousBug
Copy link
Contributor

Sorry again for the confusion, this has been merged with Dendron 0.89.

@SeriousBug SeriousBug added the status.info-needed More information is needed from filer for issue to be actionable label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope.publish Static site generation, sending note links and anything to do with publishing your notes. scope.views Related to Preview, TreeView, UI Panels, and other webviews status.info-needed More information is needed from filer for issue to be actionable type.bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants