EnlighterJS / Plugin.WordPress

:package: Official WordPress Plugin of EnlighterJS
http://wordpress.org/plugins/enlighter/
GNU General Public License v2.0
118 stars 17 forks source link

Just tried v4 beta with bPress #224

Closed ajtruckle closed 4 years ago

ajtruckle commented 4 years ago

The reason it did not show before was because we did not have the TinyMCE toolbar showing on the front end. So that is good.

I have just tested in my staging sight and in principle it was working for bbPress. The hover toolbar is there etc. But, there is one big issue. Please look:

v4-beta

Once I hit submit to the issue it is showing the enlighter syntax styles code and the raw code underneath.

ajtruckle commented 4 years ago

The element that is visible is:

<pre class="enlighter-raw">&lt;xsl:template name="MEMORIAL-WEEKEND"&gt;
  &lt;!-- 1. Is there a Special Event associated with this week? --&gt;
  &lt;!-- 2. Is it the Memorial? --&gt;
  &lt;!-- 3. Is the Memorial at the Weekend? --&gt;
  &lt;!-- If the answers are all Yes then we must display the Special Event information. --&gt;
  &lt;xsl:if test="@SpecialEvent=1 and SpecialEvent/Date/@Memorial=1 and SpecialEvent/Date/@MidweekEvent=0"&gt;
    &lt;table class="tableWeekend"&gt;
      &lt;tr&gt;
        &lt;!-- We need to use a colspan of 4 for consitency with the logic of the SpecialEvent template. --&gt;
        &lt;td class ="cellWEEKEND" colspan="4"&gt;
          &lt;div class="textWEEKEND" style="float:left"&gt;
            &lt;xsl:value-of select="//Labels/PTS_WeekendMeeting"/&gt;
          &lt;/div&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;xsl:apply-templates select="SpecialEvent"/&gt;
    &lt;/table&gt;
  &lt;/xsl:if&gt;
&lt;/xsl:template&gt;</pre>

Is there a setting I have not ticked, or is this a bug with something?

AndiDittrich commented 4 years ago

it's your theme ....

ajtruckle commented 4 years ago

How do I fix this then? As you know, I was not having this issue with the previous EnlighterJS.

AndiDittrich commented 4 years ago

but you've had a lot of other issue ...

normally this behaviour should never appear...there must be some weak selectors used by bbPress or the theme.

maybe i should remove the bbPress support from the plugin since it causes such issues :(

ajtruckle commented 4 years ago

No! You can't remove bbPress!! Please! I love this plugin and it is the only one that works with bbPress. This is the only issue I have encountered with the beta.

AndiDittrich commented 4 years ago

but this issue is very serious... can you post the url to this testpost ?

ajtruckle commented 4 years ago

I have just compared the two topics in my live site and the staging site.

The only difference is that on the live site it has display: none; and on your beta it does not.

Old: <pre style="display: none;"> Beta: <pre class="enlighter-raw">

As soon as I manually change it:

<pre class="enlighter-raw" style="display: none;">

Problem solved.

ajtruckle commented 4 years ago

I don't want to post a url to a test post because I don't like exposing the staging site url. I am happy to create a public forum again with this test code if required. But I personally think we are just lacking this display: none;. Please advise. Thanks.

AndiDittrich commented 4 years ago

that's not solved ;) something is overriding the enlighter-raw styles which already includes display: none

ajtruckle commented 4 years ago

It is the bbPress styling, here:

style-pack

If you just add !important to your class then it takes precedence according to my testing here.

ajtruckle commented 4 years ago

result

See?

AndiDittrich commented 4 years ago

i see but !important attribute should never be used by libraries such way... a better solution might to replace the pre tag with a div

the issue is still caused by the bbPress id selector ..

ajtruckle commented 4 years ago

i see but !important attribute should never be used by libraries such way... a better solution might to replace the pre tag with a div

Ok, only you can decide that I guess!

the issue is still caused by the bbPress id selector ..

Ok, sorry about that. From what I can tell this is the only issue. I tried editing a post and editing the code settings to highlight lines and it worked.

Once you are happy to confirm a way forward (as I know it is late there!) I will be happy to try it again, first on the staging and then on my live site.

AndiDittrich commented 4 years ago

thanks for the hint regarding bbPress

ajtruckle commented 4 years ago

I realise too that we can't use !important because when you want to toggle the code ... :)

ajtruckle commented 4 years ago

The only other thing I have noticed (and this might be because it is beta) in the old version when you hovered over your toolbar buttons - over the code view) it showed tooltips. In the beta it does not (in bbPress anyway). Other than that observation, looks great.

Confirmed, normal posts (like Gutenberg blocks) also don't show the tooltip on your hover menu either. So it is not just a bbPress matter.

hover

If you don't mind, I will delete the staging site now and I will happily re-create it and try your updated v4 beta when you are ready.

AndiDittrich commented 4 years ago

tooltipps are not implemented yet. the old version uses generic title attributes which was not suitable for a modern react/jsx based app.

ajtruckle commented 4 years ago

tooltipps are not implemented yet. the old version uses generic title attributes which was not suitable for a modern react/jsx based app.

Then I think for the most part this was a very successful test exercise with v4 beta in bbPress. Just the one issue. I will delete the staging now until I here from you and I will test. Night!

ajtruckle commented 4 years ago

The alternative is to do it like your older version and use inline styles instead of a class.

Does it need a class? It is raw code and thus as plain as possible. Or, maybe just use inline for bbPress mode.

Just ideas. I am sure you thought of them already along with your other suggestion of div.

Heck, my alarm just gone off. Time to get up. Early start at work.

AndiDittrich commented 4 years ago

the EnlighterJS library is a monolithic component and doesn't have any "bbPress" mode or similar - it has to work in a generic way.

ajtruckle commented 4 years ago

the EnlighterJS library is a monolithic component and doesn't have any "bbPress" mode or similar - it has to work in a generic way.

Understood. So hopefully it will be ok with a div Like you said. If that also didn’t work I would have to go over to the BBPress forum for advice.

I let us hope it will just be ok. #excited.

ajtruckle commented 4 years ago

More positive news. With my "live" site and the current EnlighterJS my topics mess up when I choose to not show line numbers (theme style issue).

But, the same does not happen with the new version. They display and render fine! :) So that is good. Is it hard to try changing the pre to a div?

AndiDittrich commented 4 years ago

great! it's already changed in the v3.2 branch

ajtruckle commented 4 years ago

great! it's already changed in the v3.2 branch

Does that mean there is a branch I can download? I can't see any recent commits.

AndiDittrich commented 4 years ago

no - i'm talking about EnlighterJS not Enlighter Wordpress Plugin

ajtruckle commented 4 years ago

Is this not that then? 14F9C496-B293-4FEF-B7F6-9176C59D1F8E

AndiDittrich commented 4 years ago

you're not familiar with git ?

the development is done locally, when a stable stage is reached it will be pushed to the origin repository. v3.2 is the current development branch projected as next release - there is no preview version available

ajtruckle commented 4 years ago

I getcha. I use TortoiseGit with BitBucket. Understood.

AndiDittrich commented 4 years ago

v4.1 is out including EnlighterJS v3.2.0 - this should address to bbPress issue

ajtruckle commented 4 years ago

Yep, the tips are showing. :)