freeCodeCamp / publish

> Content backend platform for /news
https://publish.freecodecamp.org
BSD 3-Clause "New" or "Revised" License
10 stars 9 forks source link

fix: inline code style to hide backticks #426

Open sidemt opened 5 months ago

sidemt commented 5 months ago

Checklist:

Closes #XXXXX

This is the fix I mentioned in: https://github.com/freeCodeCamp/publish/pull/418#pullrequestreview-1856550901

The backticks around inline code are added by TipTap with using ::before and ::after pseudo elements. Playwright doesn't seem to have a way to access pseudo elements, so I couldn't find a way to test the style of hiding them.

ojeytonwilliams commented 5 months ago

Playwright doesn't seem to have a way to access pseudo elements, so I couldn't find a way to test the style of hiding them.

evaluate should do the trick. You can use window.getComputedStyle(element, '::before'); to find the pseudo element and then check that it's content is 'none'.

Also, I noticed the UX is a bit confusing. When I toggle the code, the editor loses focus and I have to click on it to continue editing. I think it would be nice if I could just continue typing. For reference Github comments have exactly the UX I'm talking about.