diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index 293d32daff..b26741dc11 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -51,6 +51,8 @@ from django import forms from django.contrib.staticfiles import finders +import rfc2html + import debug # pyflakes:ignore from ietf.doc.models import ( Document, DocHistory, DocEvent, BallotDocEvent, BallotType, @@ -80,7 +82,7 @@ from ietf.review.models import ReviewAssignment from ietf.review.utils import can_request_review_of_doc, review_assignments_to_list_for_docs, review_requests_to_list_for_docs from ietf.review.utils import no_review_from_teams_on_doc -from ietf.utils import markup_txt, log, markdown +from ietf.utils import log, markdown from ietf.utils.draft import PlaintextDraft from ietf.utils.response import permission_denied from ietf.utils.text import maybe_split @@ -264,7 +266,9 @@ def document_main(request, name, rev=None, document_html=False): file_urls, found_types = build_file_urls(doc) content = doc.text_or_error() # pyflakes:ignore - content = markup_txt.markup(maybe_split(content, split=split_content)) + content = maybe_split(content, split=split_content) + if content: + content = rfc2html.markup(content) if not found_types: content = "This RFC is not currently available online." @@ -400,7 +404,9 @@ def document_main(request, name, rev=None, document_html=False): file_urls, found_types = build_file_urls(doc) content = doc.text_or_error() # pyflakes:ignore - content = markup_txt.markup(maybe_split(content, split=split_content)) + content = maybe_split(content, split=split_content) + if content: + content = rfc2html.markup(content) latest_revision = doc.latest_event(NewRevisionDocEvent, type="new_revision") @@ -775,7 +781,7 @@ def document_main(request, name, rev=None, document_html=False): content = "A conflict review response has not yet been proposed." else: content = doc.text_or_error() # pyflakes:ignore - content = markup_txt.markup(content) + content = markdown.markdown(content) ballot_summary = None if doc.get_state_slug() in ("iesgeval", ) and doc.active_ballot(): @@ -890,8 +896,6 @@ def document_main(request, name, rev=None, document_html=False): basename = "{}.txt".format(doc.name) pathname = os.path.join(doc.get_file_path(), basename) content = get_unicode_document_content(basename, pathname) - # If we want to go back to using markup_txt.markup_unicode, call it explicitly here like this: - # content = markup_txt.markup_unicode(content, split=False, width=80) assignments = ReviewAssignment.objects.filter(review__name=doc.name) review_assignment = assignments.first() diff --git a/ietf/templates/doc/document_draft.html b/ietf/templates/doc/document_draft.html index 8d9abf284f..39c04943f4 100644 --- a/ietf/templates/doc/document_draft.html +++ b/ietf/templates/doc/document_draft.html @@ -15,7 +15,15 @@ {% endblock %} -{% block morecss %}.inline { display: inline; }{% endblock %} +{% block morecss %} + .rfcmarkup :is(h1, h2, h3, h4, h5, h6), + .rfcmarkup :is(.h1, .h2, .h3, .h4, .h5, .h6) { + font-weight: bold; + font-size: 1em; + } + .rfcmarkup .newpage { margin-top: -1.5em; } + .rfcmarkup .grey, hr { opacity: .25; } +{% endblock %} {% block title %} {% if doc.type_id == "rfc" and not snapshot %} RFC {{ rfc_number }} - {{ doc.title }} @@ -658,7 +666,7 @@ Nits -