mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: fix pseudo_markdown
This commit is contained in:
parent
bf4167670d
commit
ca1246b87a
@ -11,8 +11,8 @@ import os
|
||||
|
||||
from collections import OrderedDict
|
||||
from datetime import timedelta
|
||||
|
||||
from babel.dates import format_timedelta
|
||||
from markupsafe import Markup
|
||||
from werkzeug import utils
|
||||
|
||||
from odoo.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
|
||||
@ -151,5 +151,5 @@ def pseudo_markdown(text):
|
||||
def code_replace(match):
|
||||
return f'<code>{codes[int(match.group(1))]}</code>'
|
||||
|
||||
text = re.sub(r'<code>(\d+)</code>', code_replace, text, flags=re.DOTALL)
|
||||
text = Markup(re.sub(r'<code>(\d+)</code>', code_replace, text, flags=re.DOTALL))
|
||||
return text
|
||||
|
@ -180,8 +180,8 @@ class TestBuildResult(RunbotCase):
|
||||
})
|
||||
self.assertEqual(build.md_description, 'A nice <strong>description</strong>')
|
||||
|
||||
build.description = "<script>console.log('foo')</script>"
|
||||
self.assertEqual(build.md_description, "<script>console.log('foo')</script>")
|
||||
build.description = "<script>console.log(foo)</script>"
|
||||
self.assertEqual(build.md_description, "<script>console.log(foo)</script>")
|
||||
|
||||
@patch('odoo.addons.runbot.models.build.BuildResult._get_available_modules')
|
||||
def test_filter_modules(self, mock_get_available_modules):
|
||||
|
Loading…
Reference in New Issue
Block a user