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
b61c9b67
Commit
b61c9b67
authored
12 years ago
by
David Mignot
Committed by
Marijn Haverbeke
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix coffeescript comments with 4 #, which are single line comments formated as title in docco
parent
8b91b3ab
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/coffeescript/coffeescript.js
+6
-0
6 additions, 0 deletions
mode/coffeescript/coffeescript.js
mode/coffeescript/index.html
+6
-0
6 additions, 0 deletions
mode/coffeescript/index.html
with
12 additions
and
0 deletions
mode/coffeescript/coffeescript.js
+
6
−
0
View file @
b61c9b67
...
...
@@ -60,6 +60,12 @@ CodeMirror.defineMode('coffeescript', function(conf) {
var
ch
=
stream
.
peek
();
// Handle docco title comment (single line)
if
(
stream
.
match
(
"
####
"
))
{
stream
.
skipToEnd
();
return
'
comment
'
;
}
// Handle multi line comments
if
(
stream
.
match
(
"
###
"
))
{
state
.
tokenize
=
longComment
;
...
...
This diff is collapsed.
Click to expand it.
mode/coffeescript/index.html
+
6
−
0
View file @
b61c9b67
...
...
@@ -46,12 +46,18 @@ root = this
# Save the previous value of the `_` variable.
previousUnderscore = root._
### Multiline
comment
###
# Establish the object that gets thrown to break out of a loop iteration.
# `StopIteration` is SOP on Mozilla.
breaker = if typeof(StopIteration) is 'undefined' then '__break__' else StopIteration
#### Docco style single line comment (title)
# Helper function to escape **RegExp** contents, because JS doesn't have one.
escapeRegExp = (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1')
...
...
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