orgapp / gatsby-orga Public
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
Incorrect link handling #14
Comments
|
On the subject of link formatting: It seems to apply to any formatting within a link: In this screenshot, the text between the I have also noticed that the lack of formatting happens within other blocks (such as This image shows how formatting is not applied within this |
|
For posterity and if anyone else runs into the first of these problems (links not being transformed properly), here's a workaround you can wrap your html content in to transform untransformed org links to HTML anchor tags: // create anchor tag
const anchorTag = (url, text) => `<a href="${url}">${text ?? url}</a>`
// transform org links in `input` to anchor tags
export const transformLinks = input =>
input.replace(/\[\[([^\]]+)\](\[([^[\]]*)\])?\]/g, (_, url, __, text) =>
anchorTag(url, text),
)This assumes that you don't use the org link pattern for any other parts of your content. |


Orga doesn't appear to handle links in definition lists, and also does not apply the correct formatting if a link is formatted as source code using the
~character.I appreciate that these are two separate issues, but I hope you don't mind me opening them together, as the images show both issues.
Expected outcome
~characters, I expect it to be rendered in a<code>tag.As a visual, I expected the rendered text to look like this (as rendered by Pandoc and Hakyll):

Notice the definition list 'header', and the two links at the end of the paragraph,
MaybeandEitherActual outcome
<code>are not, and are instead just surrounded by~characters in the rendered HTML output.Here's what Orga and Gatsby renders:

In this image, the header is rendered as the literal link text content in org mode and is not a link. The two links at the end are surrounded by
~characters and are not in<code>tags.The text was updated successfully, but these errors were encountered: