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

how to use Formatter and htmlRender together? #403

Closed
simonjhy opened this issue Apr 23, 2020 · 3 comments
Closed

how to use Formatter and htmlRender together? #403

simonjhy opened this issue Apr 23, 2020 · 3 comments

Comments

@simonjhy
Copy link

Is your feature request related to a problem? Please describe.
I want to convert markdown to html and use it in offline mode. So I also want to replace the html link to local file refernce.

Describe the solution you'd like
I found the htmlRender and formatter inherit from Render interface.

Describe alternatives you've considered
Is there a solution to make markdown convert to html and replace html link to local file reference at the same time.

Additional context
Add any other context or screenshots about the feature request here.

@vsch
Copy link
Owner

vsch commented Apr 23, 2020

@simonjhy, you do not need a Formatter if you only need HTML rendering.

You should look into implementing your own LinkResolver which will examine and modify links for HTML rendering. Link resolver is used to convert the URL in markdown to the URL used in rendering.

LinkResolver.java

Some samples which use it:

CustomContextDataSample.java
CustomLinkResolverSample.java
PegdownCustomLinkResolverOptions.java

@simonjhy
Copy link
Author

thanks your suggestion

@ghost
Copy link

ghost commented Jan 4, 2021

@simonjhy, if you're satisfied with the answer, please close the ticket.

@simonjhy simonjhy closed this as completed Mar 5, 2022
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

No branches or pull requests

2 participants