Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reuse 'apply_markdown' function in 'render_markdown' templatetag func#5469

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
carltongibson merged 3 commits intoencode:masterfromgem:markdown-refact
Oct 2, 2017
Merged
Changes fromall 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
7 changes: 4 additions & 3 deletionsrest_framework/templatetags/rest_framework.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,8 @@
from django.utils.safestring import SafeData, mark_safe

from rest_framework.compat import (
NoReverseMatch, markdown, pygments_highlight, reverse, template_render
NoReverseMatch, apply_markdown, pygments_highlight, reverse,
template_render
)
from rest_framework.renderers import HTMLFormRenderer
from rest_framework.utils.urls import replace_query_param
Expand DownExpand Up@@ -68,9 +69,9 @@ def form_for_link(link):

@register.simple_tag
def render_markdown(markdown_text):
ifnot markdown:
ifapply_markdown is None:
return markdown_text
return mark_safe(markdown.markdown(markdown_text))
return mark_safe(apply_markdown(markdown_text))


@register.simple_tag
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp