mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-27 14:40:23 +00:00
Add Block_comments to skipped token types
This commit is contained in:
parent
f1648d3c2a
commit
d0d79c9154
@ -292,7 +292,7 @@
|
||||
// Just continue formatting and the behavior should be logical.
|
||||
// Also ignore unknown tokens. Again, this should result in better behavior.
|
||||
if (token_type !== 'TK_INLINE_COMMENT' && token_type !== 'TK_COMMENT' &&
|
||||
token_type !== 'TK_UNKNOWN') {
|
||||
token_type !== 'TK_BLOCK_COMMENT' && token_type !== 'TK_UNKNOWN') {
|
||||
last_last_text = flags.last_text;
|
||||
last_type = token_type;
|
||||
flags.last_text = token_text;
|
||||
|
@ -329,7 +329,7 @@ class Beautifier:
|
||||
|
||||
# The cleanest handling of inline comments is to treat them as though they aren't there.
|
||||
# Just continue formatting and the behavior should be logical.
|
||||
if token_type != 'TK_INLINE_COMMENT' and token_type != 'TK_COMMENT' and token_type != 'TK_UNKNOWN':
|
||||
if token_type != 'TK_INLINE_COMMENT' and token_type != 'TK_COMMENT' and token_type != 'TK_BLOCK_COMMENT' and token_type != 'TK_UNKNOWN':
|
||||
self.last_last_text = self.flags.last_text
|
||||
self.last_type = token_type
|
||||
self.flags.last_text = self.token_text
|
||||
|
Loading…
Reference in New Issue
Block a user