EnlighterJS / Plugin.Gutenberg

:pencil: Official EnlighterJS Plugin for WordPress Gutenberg Editor
Mozilla Public License 2.0
20 stars 1 forks source link

rangeCount checking is required before calling getRangeAt() in safari. #36

Closed phruse closed 2 years ago

phruse commented 2 years ago

WordPress Editing Mode Gutenberg

Frontend or Backend Issue Backend Issue

To Reproduce when clicking on inline code area is displayed that β€œThis block has encountered an error and cannot be previewed.”.

Screenshots

스크란샷 2022-03-09 α„‹α…©α„Œα…₯ᆫ 12 48 35

Modify resources/gutenberg/enlighterjs.gutenberg.min.css

... ,t=e&&e.getRangeAt(0), ...

to

... ,t=e&&e.rangeCount>0&&e.getRangeAt(0), ...

Now it will work in safari! πŸ˜„

Desktop (please complete the following information):

AndiDittrich commented 2 years ago

thanks @phruse

i'll check this soon