Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gab
H
hydra
hydra-modules
gab-parse
Commits
d97792d7
Commit
d97792d7
authored
Jul 20, 2019
by
Rob Colbert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated to new hashtag location
parent
fba0b475
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
gab-parse.js
gab-parse.js
+4
-4
No files found.
gab-parse.js
View file @
d97792d7
...
...
@@ -13,7 +13,7 @@ module.exports = (options) => {
return
`<a href="https://gab.com/
${
mention
.
slice
(
1
)}
">
${
mention
}
</a>`
;
},
replaceHashtag
:
(
tag
)
=>
{
return
`<a href="https://gab.com/
hash
/
${
tag
.
slice
(
1
)}
">
${
tag
}
</a>`
;
return
`<a href="https://gab.com/
tags
/
${
tag
.
slice
(
1
)}
">
${
tag
}
</a>`
;
}
};
...
...
@@ -30,7 +30,7 @@ module.exports = (options) => {
return
(
text
)
=>
{
var
parseRegEx
=
/
(
^|
\s)(
#|@
)\w{3,30}\b
/g
;
var
slugs
=
{
};
var
tags
=
text
.
match
(
parseRegEx
);
if
(
!
tags
||
!
tags
.
length
)
{
return
text
;
...
...
@@ -43,7 +43,7 @@ module.exports = (options) => {
.
filter
((
tag
)
=>
{
return
!
slugs
[
tag
]
&&
(
slugs
[
tag
]
=
true
);
});
tags
.
forEach
((
tag
)
=>
{
switch
(
tag
[
0
])
{
case
'
@
'
:
...
...
@@ -58,7 +58,7 @@ module.exports = (options) => {
break
;
}
});
return
text
;
};
};
\ No newline at end of file
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