Skip to content

Commit 52b1749

Browse files
committed
Fix formatting of #-only lines in herecomments
Before: $ ./bin/coffee -bpe '### > # paragraph 1 > # > # paragraph 2 > ###' /* * paragraph 1 # * paragraph 2 */ After: $ ./bin/coffee -bpe '### # paragraph 1 # # paragraph 2 ###' /* * paragraph 1 * * paragraph 2 */ This does not re-break #3638: $ ./bin/coffee -bpe '### > #/ > ###' /* #/ */
1 parent ba85a38 commit 52b1749

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/coffee-script/nodes.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/nodes.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ exports.Comment = class Comment extends Base
584584
makeReturn: THIS
585585

586586
compileNode: (o, level) ->
587-
comment = @comment.replace /^(\s*)# /gm, "$1 * "
587+
comment = @comment.replace /^(\s*)#(?=\s)/gm, "$1 *"
588588
code = "/*#{multident comment, @tab}#{if '\n' in comment then "\n#{@tab}" else ''} */"
589589
code = o.indent + code if (level or o.level) is LEVEL_TOP
590590
[@makeCode("\n"), @makeCode(code)]

0 commit comments

Comments
 (0)