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

Documentation updates for lektor/lektor#1102 #362

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion content/docs/api/templates/filters/markdown/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type: filter
---
version_added: 2.0
---
body:
body:

This filter converts a markdown string into HTML. This behaves the same as
the [Markdown Type :ref](../../../db/types/markdown/).
Expand All @@ -20,3 +20,13 @@ the [Markdown Type :ref](../../../db/types/markdown/).
{{ "Hello **World**"|markdown }}
</div>
```

## Controlling URL Resolution

By default, an attempt is made to resolve relative URLs in markdown *links* and *image* tags to a *record* through the Lektor database.
This makes things “just work” when linking to images and other attachments from pages that have a non-default [alt :ref](/docs/content/alts/),
as well as in other edge cases e.g. involving custom [slug_formats :ref](/docs/models/children/#child-slug-behavior).

This behavior can be controlled by passing an optional `resolve_links` parameter to the filter.
This works like the [resolve_links :ref](/docs/api/db/types/markdown/#resolution-of-links) option of the *Markdown field type*.