Multiline comment color bug #7081

Open
opened 2023-12-22 19:29:53 +01:00 by marijnh · 0 comments
marijnh commented 2023-12-22 19:29:53 +01:00 (Migrated from gitlab.com)

Problem description

When I paste this code here, the multiline comment is the wrong color:

https://codemirror.net/5/mode/javascript/index.html

let a = 0;

class Lol
{
	static c()
	{










































































































































































































































	}

	static b()
	{

	}

	static a()
	{
		a++;
		a++;

		if (false)
		{
			a++;
			a++;

			if (false)
			{
				/*Lol.c({a: "", opts: {
					a: false,
					b: false,
					c: {
						a: false,
						b: async () => {
							a++;

							const b = await Lol.c({a: false, b: {"a": false, "b": "false"}, c: false});
							if (b.c(false)) return;

							Lol.c({a: false, b: {c: false, d: Lol["s"], e: {d: false, f: () => Lol.c()}}});
						},
					},
					x: async () => {
						const a = await Lol.c({b: false, s: {"lol": false, "kek": false}, g: false});
						if (Lol.c(false)) return;

						Lol.c();
					},
				}});*/
				
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
				a++;
			}
		}
	}
}

Observed result

observed

Expected result

This part of the code is commented out and should be the same color:

/*Lol.c({a: "", opts: {
	a: false,
	b: false,
	c: {
		a: false,
		b: async () => {
			a++;

			const b = await Lol.c({a: false, b: {"a": false, "b": "false"}, c: false});
			if (b.c(false)) return;

			Lol.c({a: false, b: {c: false, d: Lol["s"], e: {d: false, f: () => Lol.c()}}});
		},
	},
	x: async () => {
		const a = await Lol.c({b: false, s: {"lol": false, "kek": false}, g: false});
		if (Lol.c(false)) return;

		Lol.c();
	},
}});*/

Affected browsers/platforms: Chrome 120.0.6099.111, Windows 11

## Problem description When I paste this code here, the multiline comment is the wrong color: https://codemirror.net/5/mode/javascript/index.html ```js let a = 0; class Lol { static c() { } static b() { } static a() { a++; a++; if (false) { a++; a++; if (false) { /*Lol.c({a: "", opts: { a: false, b: false, c: { a: false, b: async () => { a++; const b = await Lol.c({a: false, b: {"a": false, "b": "false"}, c: false}); if (b.c(false)) return; Lol.c({a: false, b: {c: false, d: Lol["s"], e: {d: false, f: () => Lol.c()}}}); }, }, x: async () => { const a = await Lol.c({b: false, s: {"lol": false, "kek": false}, g: false}); if (Lol.c(false)) return; Lol.c(); }, }});*/ a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; a++; } } } } ``` ## Observed result <img width="456" alt="observed" src="https://github.com/codemirror/codemirror5/assets/91274932/e063cf75-c54e-49e0-a97b-afa181f0dbb2"> ## Expected result This part of the code is commented out and should be the same color: ```js /*Lol.c({a: "", opts: { a: false, b: false, c: { a: false, b: async () => { a++; const b = await Lol.c({a: false, b: {"a": false, "b": "false"}, c: false}); if (b.c(false)) return; Lol.c({a: false, b: {c: false, d: Lol["s"], e: {d: false, f: () => Lol.c()}}}); }, }, x: async () => { const a = await Lol.c({b: false, s: {"lol": false, "kek": false}, g: false}); if (Lol.c(false)) return; Lol.c(); }, }});*/ ``` **Affected browsers/platforms:** Chrome 120.0.6099.111, Windows 11
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#7081
No description provided.