Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.4.4 can not deal with css attribute selector whose value is suffixed (followed) by value #313

Closed
wkevin opened this issue Nov 20, 2021 · 1 comment · Fixed by #314
Closed
Labels
bug Something isn't working

Comments

@wkevin
Copy link

wkevin commented Nov 20, 2021

Version of Marp Tool

Marp-VSCode 1.4.4

Operating System

Linux

Environment

  • OS version: Ubuntu 20.04
  • Node.js version: 14.18.1
  • VS Code version (Marp for VS Code): 1.61.2

How to reproduce

  1. Upgrade Marp-vscode to 1.4.4 from 1.4.3
  2. use css code like: section[class$='bar']
  3. $= can not work
  4. but class^='foo' is well

Expected behavior

section[class$='bar'] can select class whose name is suffixed by 'bar'

Actual behavior

section[class$='bar'] do not work

Additional information

md file:

---
marp: true
theme: main
---

<style>
section[class^='foo'] h1 {
  color: red;
}

section[class$='bar'] h2 {
  color: blue;
}
</style>

# Hello

<!-- _class: foobar -->

## World
@wkevin wkevin added the bug Something isn't working label Nov 20, 2021
@yhatt
Copy link
Member

yhatt commented Nov 20, 2021

VS Code syncs scroll of preview and Markdown by adding code-line class to each elements, and adds code-line-active class when there is a caret in a corresponding Markdown line.
https://github.com/microsoft/vscode/blob/7d46b77c311ef8698d09311189550d93bdca360d/extensions/markdown-language-features/src/markdownEngine.ts#L21-L40

Marp for VS Code v1.4.4 adds this class into every elements that have mapped to the Markdown line, so their elements may break $= in the CSS selector. We have the slide wrapper (<div>) in parent so just preventing to add the class in Marp <section> elements for the slide should be going to work like v1.4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants