Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
origin-web-common
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
Java-于龙
origin-web-common
Commits
bb3419e7
Commit
bb3419e7
authored
Oct 11, 2017
by
Sam Padgett
Committed by
GitHub
Oct 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #226 from spadgett/linkify-regex
Tighten down linkify URL matching
parents
f379331b
1a7413f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
origin-web-common-ui.js
dist/origin-web-common-ui.js
+1
-1
origin-web-common.js
dist/origin-web-common.js
+1
-1
origin-web-common.min.js
dist/origin-web-common.min.js
+1
-1
htmlService.js
src/ui-services/htmlService.js
+1
-1
No files found.
dist/origin-web-common-ui.js
View file @
bb3419e7
...
@@ -2215,7 +2215,7 @@ angular.module("openshiftCommonUI")
...
@@ -2215,7 +2215,7 @@ angular.module("openshiftCommonUI")
}
}
// Replace any URLs with links.
// Replace any URLs with links.
return
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
\S
*
[^\s
.;,()
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
return
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
[^\s
<
]
*
[^\s
.,()
\[\]
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
if
(
target
)
{
if
(
target
)
{
return
"<a href=
\"
"
+
str
+
"
\"
target=
\"
"
+
target
+
"
\"
>"
+
str
+
" <i class=
\"
fa fa-external-link
\"
aria-hidden=
\"
true
\"
></i></a>"
;
return
"<a href=
\"
"
+
str
+
"
\"
target=
\"
"
+
target
+
"
\"
>"
+
str
+
" <i class=
\"
fa fa-external-link
\"
aria-hidden=
\"
true
\"
></i></a>"
;
}
}
...
...
dist/origin-web-common.js
View file @
bb3419e7
...
@@ -5918,7 +5918,7 @@ angular.module("openshiftCommonUI")
...
@@ -5918,7 +5918,7 @@ angular.module("openshiftCommonUI")
}
}
// Replace any URLs with links.
// Replace any URLs with links.
return
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
\S
*
[^\s
.;,()
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
return
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
[^\s
<
]
*
[^\s
.,()
\[\]
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
if
(
target
)
{
if
(
target
)
{
return
"<a href=
\"
"
+
str
+
"
\"
target=
\"
"
+
target
+
"
\"
>"
+
str
+
" <i class=
\"
fa fa-external-link
\"
aria-hidden=
\"
true
\"
></i></a>"
;
return
"<a href=
\"
"
+
str
+
"
\"
target=
\"
"
+
target
+
"
\"
>"
+
str
+
" <i class=
\"
fa fa-external-link
\"
aria-hidden=
\"
true
\"
></i></a>"
;
}
}
...
...
dist/origin-web-common.min.js
View file @
bb3419e7
...
@@ -2630,7 +2630,7 @@ return !0;
...
@@ -2630,7 +2630,7 @@ return !0;
}
}
},
},
linkify
:
function
(
text
,
target
,
alreadyEscaped
)
{
linkify
:
function
(
text
,
target
,
alreadyEscaped
)
{
return
text
?
(
alreadyEscaped
||
(
text
=
_
.
escape
(
text
)),
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
\S
*
[^\s
.;,()
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
return
text
?
(
alreadyEscaped
||
(
text
=
_
.
escape
(
text
)),
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
[^\s
<
]
*
[^\s
.,()
\[\]
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
return
target
?
'<a href="'
+
str
+
'" target="'
+
target
+
'">'
+
str
+
' <i class="fa fa-external-link" aria-hidden="true"></i></a>'
:
'<a href="'
+
str
+
'">'
+
str
+
"</a>"
;
return
target
?
'<a href="'
+
str
+
'" target="'
+
target
+
'">'
+
str
+
' <i class="fa fa-external-link" aria-hidden="true"></i></a>'
:
'<a href="'
+
str
+
'">'
+
str
+
"</a>"
;
}))
:
text
;
}))
:
text
;
}
}
...
...
src/ui-services/htmlService.js
View file @
bb3419e7
...
@@ -100,7 +100,7 @@ angular.module("openshiftCommonUI")
...
@@ -100,7 +100,7 @@ angular.module("openshiftCommonUI")
}
}
// Replace any URLs with links.
// Replace any URLs with links.
return
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
\S
*
[^\s
.;,()
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
return
text
.
replace
(
/https
?
:
\/\/[
A-Za-z0-9._%+-
]
+
[^\s
<
]
*
[^\s
.,()
\[\]
{}<>"
\u
201d
\u
2019
]
/gm
,
function
(
str
)
{
if
(
target
)
{
if
(
target
)
{
return
"<a href=
\"
"
+
str
+
"
\"
target=
\"
"
+
target
+
"
\"
>"
+
str
+
" <i class=
\"
fa fa-external-link
\"
aria-hidden=
\"
true
\"
></i></a>"
;
return
"<a href=
\"
"
+
str
+
"
\"
target=
\"
"
+
target
+
"
\"
>"
+
str
+
" <i class=
\"
fa fa-external-link
\"
aria-hidden=
\"
true
\"
></i></a>"
;
}
}
...
...
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