Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-poll
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
xblock-poll
Commits
5c01fe94
Commit
5c01fe94
authored
Feb 13, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused utils and associated tests.
parent
d5d995d6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
102 deletions
+0
-102
poll/utils.py
+0
-37
tests/unit/test_utils.py
+0
-65
No files found.
poll/utils.py
deleted
100644 → 0
View file @
d5d995d6
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 McKinsey Academy
#
# Authors:
# Jonathan Piacenti <jonathan@opencraft.com>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) as published by the Free
# Software Foundation (FSF), either version 3 of the License, or (at your
# option) any later version of the AGPL published by the FSF.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program in a file in the toplevel directory called
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
#
import
bleach
from
markdown
import
markdown
ALLOWED_TAGS
=
{
'h1'
:
[],
'h2'
:
[],
'h3'
:
[],
'h4'
:
[],
'h5'
:
[],
'h6'
:
[],
'a'
:
[
'target'
,
'href'
,
'class'
],
'strong'
:
[],
'em'
:
[],
'blockquote'
:
[],
'pre'
:
[],
'li'
:
[],
'ul'
:
[],
'ol'
:
[],
'code'
:
[
'class'
],
'p'
:
[],
}
def
process_markdown
(
raw_text
):
return
bleach
.
clean
(
markdown
(
raw_text
),
tags
=
ALLOWED_TAGS
,
strip_comments
=
False
)
tests/unit/test_utils.py
deleted
100644 → 0
View file @
d5d995d6
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 McKinsey Academy
#
# Authors:
# Jonathan Piacenti <jonathan@opencraft.com>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) as published by the Free
# Software Foundation (FSF), either version 3 of the License, or (at your
# option) any later version of the AGPL published by the FSF.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program in a file in the toplevel directory called
# "AGPLv3". If not, see <http://www.gnu.org/licenses/>.
#
from
unittest
import
TestCase
from
markdown
import
markdown
class
ProcessMarkdownTest
(
TestCase
):
def
test_markdown_escapes
(
self
):
start_string
=
(
"""
## This is an H2.
<h3>This is an H3</h3>
<a href="http://example.com">This link should be preserved.</a>
[This link should be converted.](http://www.example.com)
This is a paragraph of text, despite being just one sentence.
< This should be a less-than symbol.
< So should this, since it's not attached to anything.
> This is going to be a blockquote.
<script type="text/javascript">breakstuff();</script>
"""
)
end_string
=
(
"""<h2>This is an H2.</h2>
<h3>This is an H3</h3>
<p><a href="http://example.com">This link should be preserved.</a>
<a href="http://www.example.com">This link should be converted.</a></p>
<p>This is a paragraph of text, despite being just one sentence.</p>
<p>< This should be a less-than symbol.</p>
<p>< So should this, since it's not attached to anything.</p>
<blockquote>
<p>This is going to be a blockquote.</p>
</blockquote>
<script type="text/javascript">breakstuff();</script>"""
)
self
.
assertEqual
(
end_string
,
markdown
(
start_string
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment