Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2019-05-19 06:02:40

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat_speeder

I’m using the rel attribute on links as this (but the content order into links might not interfere I think):

<a rel="nofollow noopener" href="http://reddit.com/submit?url=<txp:if_section name='<txp:variable name="avoid" />'><txp:site_url escape="url" /><txp:else /><txp:if_article_list><txp:section url="1" /><txp:else /><txp:permlink escape="url" />&amp;title=<txp:title escape="url" /></txp:if_article_list></txp:if_section>" class="tooltip" title="Reddit" aria-haspopup="true">...</a>

For the HTML comments, the problem occurs when they are empty. You want to keep the ones with no spaces in it. Is that right? If so, that is not a so difficult change to correct into the plugin code: I will see on it this coming week.

Last edited by Pat64 (2019-05-19 06:08:52)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#74 2019-05-19 06:36:07

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: pat_speeder

I have submitted a bug report re the <notextile /> tag on github, so the fix might not be necessary for the next txp release.

Re the rel order… I have no idea why it messes up when the rel attribute is after the href. Admittedly, I was just checking the pat_speeder_compact. My code is not actually that tidy in order to use it, especially after your warning that this might produce unexpected results.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#75 2019-05-19 06:54:30

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat_speeder

Yes. Because the “Compact Mode” removes all spaces (and tabs too) if they are more than 2 into the entire HTML document.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#76 2019-05-21 12:47:30

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat_speeder

Hi Yiannis.

Here is a rapid solution to your problem (not tested into a in production website but may work).

Change this line into the plugin code:

$buffer = preg_replace('/<!--([^<|\[|>|go{2}gleo]).*?-->/s', '', $buffer);

By this one instead:

$buffer = preg_replace('/<!--([^<|\s|\[|>|go{2}gleo]).*?-->/s', '', $buffer);

Here is the Regex tests.

Last edited by Pat64 (2019-05-21 12:59:39)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#77 2019-05-21 16:03:08

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: pat_speeder

Hi Patrick,

I just replaced the code but the resulting breaking page is the same:( I guess that the html tags at play in that page maybe too many.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#78 2019-05-21 16:39:38

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat_speeder

Nope.

I’m trying your code (with an HTML comment with a space in the middle):

p. Social meaning comes not just from the manifest content of communication (i.e., literal information), but also from latent content — how language is structured and used, as well as how communicators address each other, e.g., through non-verbal means — gestures, head nods, body position, and the dynamics in communication patterns.<!-- --><notextile><sup class="tooltip"><a href="#fn11" id="foot11" class="customTarget">11</a><span class="tooltiptext noprint">Nafeez Ahmed, "The Pentagon's secret pre-crime program to know your thoughts, predict your future," <em>Medium</em>. Posted 1 February 2016. <a rel="external" href="https://medium.com/insurge-intelligence/the-pentagon-s-secret-pre-crime-program-c7d281eca440">medium.com/insurge-intelligence/the-pentagon-s-secret-pre-crime-program-c7d281eca440</a> (accessed 10 May 2018).</span></sup></notextile>

And I got this (no space before the footnote):

pat_speeder set to “Compact Mode”.

Last edited by Pat64 (2019-05-21 16:41:05)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#79 2019-05-22 05:55:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: pat_speeder

Hi Patrick,

Here is the parsed page when using <!----> without the space. If you run it through the W3 validator, you will see some of the issues

ps. and here is the page again with the amendment you proposed in the plugin code.

Last edited by colak (2019-05-22 07:01:12)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#80 2019-05-22 06:57:46

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat_speeder

Please Yiannis, could you try by using a space in the middle of the HTML comment, like this:

<!-- -->

That’s how I got the result as shown into the screen capture above.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#81 2019-05-22 07:02:34

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: pat_speeder

Hi Patrick,

With the space in the middle all works just fine with the vanilla and the amended regex of the plugin.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#82 2019-05-22 07:16:14

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat_speeder

So, all is fine now?

(but this is a kind of hack just for you: I need to review this regex in order to add your problem and keep the removing process for all HTML comments (with or witout a space in the middle)!)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB