Changeset - 5d8bfda01cf5
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 5 years ago 2020-11-09 16:48:34
mads@kiilerich.com
Grafted from: eb1df032e43e
lib: drop unnecessary safe_str when processing text
2 files changed with 2 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -1052,8 +1052,7 @@ def render_w_mentions(source, repo_name=
 
    Render plain text with revision hashes and issue references urlified
 
    and with @mention highlighting.
 
    """
 
    s = safe_str(source)
 
    s = urlify_text(s, repo_name=repo_name)
 
    s = urlify_text(source, repo_name=repo_name)
 
    return literal('<div class="formatted-fixed">%s</div>' % s)
 

	
 

	
kallithea/lib/markup_renderer.py
Show inline comments
 
@@ -36,7 +36,7 @@ import markdown as markdown_mod
 
from docutils.core import publish_parts
 
from docutils.parsers.rst import directives
 

	
 
from kallithea.lib.utils2 import MENTIONS_REGEX, safe_str
 
from kallithea.lib.utils2 import MENTIONS_REGEX
 

	
 

	
 
log = logging.getLogger(__name__)
 
@@ -156,7 +156,6 @@ class MarkupRenderer(object):
 
        >>> MarkupRenderer.plain('https://example.com/')
 
        '<br /><a href="https://example.com/">https://example.com/</a>'
 
        """
 
        source = safe_str(source)
 
        if universal_newline:
 
            newline = '\n'
 
            source = newline.join(source.splitlines())
 
@@ -197,7 +196,6 @@ class MarkupRenderer(object):
 
        </pre></div>
 
        </td></tr></table>
 
        """
 
        source = safe_str(source)
 
        try:
 
            if flavored:
 
                source = cls._flavored_markdown(source)
 
@@ -215,7 +213,6 @@ class MarkupRenderer(object):
 

	
 
    @classmethod
 
    def rst(cls, source, safe=True):
 
        source = safe_str(source)
 
        try:
 
            docutils_settings = dict([(alias, None) for alias in
 
                                cls.RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES])
0 comments (0 inline, 0 general)