-
Notifications
You must be signed in to change notification settings - Fork 25
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
Providing #+NAME and #+CAPTION for images #87
Comments
As best as I can tell, the parser is grabbing this data and putting it into the
|
Hey, you're correct that I think the good behavior is to transform
into: <figure>
<img src="image.png" />
<figcaption>hello</figcaption>
</figure> I think that should be a straightforward fix somewhere around here: uniorg/packages/uniorg-rehype/src/org-to-hast.ts Lines 444 to 446 in cb0709d
|
Yes, I was thinking it would be best to just pass this data without changing how it renders, since org-export never reaches for the CAPTION or NAME, as you suggest. Instead it makes sense to me at least that uniorg would just ensure this data is passed on so that it can be used for further use if desired. |
Orgmode has a few keywords you can specify for an image and they are
#+NAME
,#+CAPTION
, and#+ATTR_
. Using Uniorg the attr values come through when I specifyATTR_HTML
(I believe this is the correct behavior). But I am not sure how to access the name or caption. For reference, I'm using AstroJS and I am overwritingimg
tags in myContent
by specifying a replacement in thecomponents
lookup attribute.When an image is processed the props provided include anything set in the
ATTR_HTML
and then thesrc
data, so filepath, format, and dimensions. I see that the parser captures these but I'm not sure if I'm doing something wrong or if they're not being passed through for further processing. https://github.com/rasendubi/uniorg/blob/cb0709da1478d92b26391e288d1133cf959e2ff7/packages/uniorg-parse/src/parser.ts#L2162C2-L2162C2The text was updated successfully, but these errors were encountered: