GoogleChrome / web.dev

The frontend, backend, and content source code for web.dev
https://web.dev
Other
3.57k stars 1.58k forks source link

Code highlight is partially failing #3291

Closed jpmedley closed 4 years ago

jpmedley commented 4 years ago

Describe the bug An embedded HTML code sample in a new article specifies that lines 3 through 7 should be highlighted. Only lines 3 through 5 are actually behing highlighted.

To Reproduce View the rendered article in any staging environment.

image

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. To prevent this from happening, leave a comment.

jpmedley commented 4 years ago

Bringing this back to life.

robdodson commented 4 years ago

I think it's the introducing of the newlines that's breaking it. I rewrote the snippet as:

image

and it seemed to highlight ok:

image

Just from an aesthetics perspective, I think I find my version a bit easier to read. I tend to prefer to horizontally scroll code samples if they run long, versus introducing whitespace which can make them a bit awkward to read.

jpmedley commented 4 years ago

That's all beside the point. This issue is about the fact that the feature's not doing what I asked or expected.

robdodson commented 4 years ago

I think it's doing that because of the introduction of newlines. That's as far as I can dig into it unfortunately.

robdodson commented 4 years ago

It might be related to this issue but I really don't know. I think this plugin is using prisma so there's a couple of levels of indirection 🤷‍♂️

jpmedley commented 4 years ago

With respect, this is not an unreasonable ask. If I ask it to highlight lines 3 through 5 and it doesn't do it, it's broken.

zachleat commented 4 years ago

Maybe worth filing upstream at the dependency here (I own the dependency, hi): https://github.com/11ty/eleventy-plugin-syntaxhighlight

jpmedley commented 4 years ago

Done.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. To prevent this from happening, leave a comment.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. To prevent this from happening, leave a comment.

jpmedley commented 4 years ago

Should we keep this open until @zachleat updates 11ty?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. To prevent this from happening, leave a comment.

stale[bot] commented 4 years ago

Closing this issue because it has been marked as stale for more than 7 days.