Skip to content

Commit

Permalink
Don't use linebreaks filter in Markdown templates (lambdamusic#64)
Browse files Browse the repository at this point in the history
The Markdown Django templates were using the linebreaks filter on some
of the content.  This filter wraps content using <p> and <br />.
However this means that if the ontology was using Markdown in their
comments this would not get rendered as most Markdown renderers don't
apply rendering inside of HTML block elements like <p>.  It was also
unnecessary since Markdown renderers already use line breaks to suitably
render paragraphs.

This was most applicable for descriptions of things since those are the
places were ontology authors were most likely to want to use Markdown to
explain the intended usage of their ontology concepts.

By removing the use of this filter the ontology descriptions are output
as-is in the generated Markdown files allowing any Markdown in them to
be rendered by whatever Markdown renderer the user ultimately chooses.
  • Loading branch information
rvesse committed Sep 27, 2023
1 parent c2b13b6 commit 3e96eaa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{{each.uri}}

#### Description
{{each.bestDescription()|linebreaks|default("--")}}
{{each.bestDescription()|default("--")}}


{% if each.ancestors() %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{{each.uri}}

#### Description
{{each.bestDescription()|linebreaks|default("--")}}
{{each.bestDescription()|default("--")}}


{% if each.ancestors() %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{each.uri}}

#### Description
{{each.bestDescription()|linebreaks|default("--")}}
{{each.bestDescription()|default("--")}}


{% if each.instance_of %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{{each.uri}}

#### Description
{{each.bestDescription()|linebreaks|default("--")}}
{{each.bestDescription()|default("--")}}

{% if each.ancestors() %}
#### Inherits from ({{ each.ancestors()|length }})
Expand Down

0 comments on commit 3e96eaa

Please sign in to comment.