Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
8ae5ed46
Commit
8ae5ed46
authored
Apr 11, 2016
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove converter.js
This logic has now been moved to render-markdown.js
parent
ece599ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
46 deletions
+0
-46
app.js
h/static/scripts/app.js
+0
-2
converter.js
h/static/scripts/filter/converter.js
+0
-24
converter-test.js
h/static/scripts/filter/test/converter-test.js
+0
-20
No files found.
h/static/scripts/app.js
View file @
8ae5ed46
...
...
@@ -180,8 +180,6 @@ module.exports = angular.module('h', [
.
directive
(
'topBar'
,
require
(
'./directive/top-bar'
))
.
directive
(
'windowScroll'
,
require
(
'./directive/window-scroll'
))
.
filter
(
'converter'
,
require
(
'./filter/converter'
))
.
service
(
'annotationMapper'
,
require
(
'./annotation-mapper'
))
.
service
(
'annotationUI'
,
require
(
'./annotation-ui'
))
.
service
(
'auth'
,
require
(
'./auth'
).
service
)
...
...
h/static/scripts/filter/converter.js
deleted
100644 → 0
View file @
ece599ff
'use strict'
;
var
showdown
=
require
(
'showdown'
);
function
targetBlank
()
{
function
filter
(
text
)
{
return
text
.
replace
(
/<a href=/g
,
'<a target="_blank" href='
);
}
return
[{
type
:
'output'
,
filter
:
filter
}];
}
module
.
exports
=
function
()
{
// see https://github.com/showdownjs/showdown#valid-options
var
converter
=
new
showdown
.
Converter
({
extensions
:
[
targetBlank
],
simplifiedAutoLink
:
true
,
// Since we're using simplifiedAutoLink we also use
// literalMidWordUnderscores because otherwise _'s in URLs get
// transformed into <em>'s.
// See https://github.com/showdownjs/showdown/issues/211
literalMidWordUnderscores
:
true
,
});
return
converter
.
makeHtml
.
bind
(
converter
);
};
h/static/scripts/filter/test/converter-test.js
deleted
100644 → 0
View file @
ece599ff
var
converter
=
require
(
'../converter'
);
describe
(
'markdown converter'
,
function
()
{
var
markdownToHTML
=
converter
();
it
(
'should autolink URLs'
,
function
()
{
assert
.
equal
(
markdownToHTML
(
'See this link - http://arxiv.org/article'
),
'<p>See this link - <a target="_blank" href="http://arxiv.org/article">'
+
'http://arxiv.org/article</a></p>'
);
});
it
(
'should autolink URLs with _
\'
s in them correctly'
,
function
()
{
assert
.
equal
(
markdownToHTML
(
'See this https://hypothes.is/stream?q=tag:group_test_needs_card'
),
'<p>See this <a target="_blank" '
+
'href="https://hypothes.is/stream?q=tag:group_test_needs_card">'
+
'https://hypothes.is/stream?q=tag:group_test_needs_card</a></p>'
);
});
});
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