Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CodeMirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Moritz Aurel Pascal Schubotz
CodeMirror
Commits
4449d55f
Commit
4449d55f
authored
10 years ago
by
Marijn Haverbeke
Browse files
Options
Downloads
Patches
Plain Diff
[textile mode] Require non-space characters directly inside phrase modifiers
Issue #2967
parent
b5e401f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mode/textile/test.js
+3
-0
3 additions, 0 deletions
mode/textile/test.js
mode/textile/textile.js
+5
-3
5 additions, 3 deletions
mode/textile/textile.js
with
8 additions
and
3 deletions
mode/textile/test.js
+
3
−
0
View file @
4449d55f
...
...
@@ -411,4 +411,7 @@
MT
(
'
phrase-non-word
'
,
'
[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]
'
);
MT
(
'
phrase-lone-dash
'
,
'
foo - bar - baz
'
);
})();
This diff is collapsed.
Click to expand it.
mode/textile/textile.js
+
5
−
3
View file @
4449d55f
...
...
@@ -117,14 +117,16 @@
}
function
togglePhraseModifier
(
stream
,
state
,
phraseModifier
,
closeRE
,
openSize
)
{
var
charBefore
=
stream
.
pos
>
openSize
?
stream
.
string
.
charAt
(
stream
.
pos
-
openSize
-
1
)
:
null
;
var
charAfter
=
stream
.
peek
();
if
(
state
[
phraseModifier
])
{
if
(
stream
.
match
(
/^
(
$|
\W)
/
,
fals
e
))
{
if
(
(
!
charAfter
||
/
\W
/
.
test
(
charAfter
))
&&
charBefore
&&
/
\S
/
.
test
(
charBefor
e
))
{
var
type
=
tokenStyles
(
state
);
state
[
phraseModifier
]
=
false
;
return
type
;
}
}
else
if
((
stream
.
pos
==
openSize
||
/
\W
/
.
test
(
stream
.
string
.
charAt
(
stream
.
pos
-
1
-
openSize
))
)
&&
stream
.
match
(
new
RegExp
(
"
^.*
"
+
closeRE
.
source
+
"
(?
=
\\
W|$)
"
),
false
))
{
}
else
if
((
!
charBefore
||
/
\W
/
.
test
(
charBefore
))
&&
charAfter
&&
/
\S
/
.
test
(
charAfter
)
&&
stream
.
match
(
new
RegExp
(
"
^.*
\\
S
"
+
closeRE
.
source
+
"
(?
:
\\
W|$)
"
),
false
))
{
state
[
phraseModifier
]
=
true
;
state
.
mode
=
Modes
.
attributes
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment