Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-11-05 06:50:04

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

[textile] Blockquotes the HTML5 way, a little surprised

Experimenting with ways to generate blockquotes with nested footer element, the html5 way, using TXP4.6dev.

1/ As one would expect, this works (notextile.):

notextile. <blockquote cite="http://example.com/">Blockquote with footer (wrapped in <code>notextile.</code>)<p>Here is an example of a block quote. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
 <footer>— <cite><a href="http://example.com/">anonymous</a></cite></footer></blockquote>

2/ This sorta works, to my surprise (make sure to scroll to te right if needed):

bq..:http://example.com/ Blockquote with footer (using @textile@)

Here is an example of a block quote. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <footer>— ??<a href="http://example.com/">anonymous</a>?? </footer>

and generates this HTML code:

<blockquote cite="http://example.com/">
	<p>Blockquote with footer (using <code>textile</code>)</p>
	<p>Here is an example of a block quote. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </p><footer>— <cite><a href="http://example.com/">anonymous</a></cite></footer><p></p>
</blockquote>

But note that I had to use plain HML markup inside the cite element and secondly, this generates an extra, empty, <p></p> at the end (before the closing <blockquote>). Using "??foo??":http://example.com works, but generates <a href="http://example.com"><cite>foo</cite></a>. I’d prefer the cite element to wrap around the a element.

Thirdly, the opening <footer> must be on the same line as (and part of) the second (last) paragraph. Otherwise, either it generates a <br/> (in case I insert only one line-break after the last paragraph, or an additional empty <p /> before the footer (with two line-breaks). No ideal for readability…

Finally a question: is this textile way future-proof? Or would a potential upgrade to Textile (either adding full html 5 elements support or more sophisticate multiline blockquote support) break this pattern? In which case I better use notextile. for the time being.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#2 2013-11-05 07:14:10

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Blockquotes the HTML5 way, a little surprised

4.6-dev doesn’t currently use the current version of Textile. The current development version and the newest release of Textile generate different output. Current release doesn’t add extra paragraph, the footer will be wrapped in a paragraph (as it should with that input), cite works in inline and paragraph indentation is different.

<blockquote cite="http://example.com/">
	<p>Blockquote with footer (using <code>textile</code>)</p>

	<p>Here is an example of a block quote. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <footer>— <cite><a href="http://example.com/">anonymous</a></cite> </footer></p>
</blockquote>

In the current development version you can wrap links in spans:

??"anonymous":http://example.com/??

…as long as the span is followed by space or punctation mark.

To answer your question, yes, you should use notextile.. Otherwise the footer gets wrapped in a paragraph. The output you are getting with broken double paragraph is a bug in the version used by Textpattern 4.6-dev. The footer is supposed to be enclosed in a paragraph, but for some reason it isn’t and is instead cut off.

Last edited by Gocom (2013-11-05 07:19:55)

Offline

#3 2013-11-05 08:30:17

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: [textile] Blockquotes the HTML5 way, a little surprised

Gocom wrote:

In the current development version you can wrap links in spans:

Ah, that is good to hear!

To answer your question, yes, you should use notextile.. Otherwise the footer gets wrapped in a paragraph. The output you are getting with broken double paragraph is a bug in the version used by Textpattern 4.6-dev. The footer is supposed to be enclosed in a paragraph, but for some reason it isn’t and is instead cut off.

Ok thanks, notextile.. it is then. Out of curiosity, when will the current Textile version land in TXP-dev? (no I don’t think I feel like hacking around in current TXP4.6-dev to use the Github version…)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2013-11-05 08:39:39

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Blockquotes the HTML5 way, a little surprised

phiw13 wrote:

Ok thanks, notextile.. it is then. Out of curiosity, when will the current Textile version land in TXP-dev? (no I don’t think I feel like hacking around in current TXP4.6-dev to use the Github version…)

Sometime future; probably after the last 2.5.x update, Textile v2.5.4. After 2.5.4 Textpattern will never again get Textile updates (apart from security updates) or new features unless Textpattern updates to PHP 5.3.0.

The current Textile version included with 4.6-dev doesn’t really matter, since it isn’t meant for production.

Last edited by Gocom (2013-11-05 08:44:41)

Offline

#5 2013-11-05 12:20:29

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: [textile] Blockquotes the HTML5 way, a little surprised

Gocom wrote:

After 2.5.4 Textpattern will never again get Textile updates (apart from security updates) or new features unless Textpattern updates to PHP 5.3.0.

Oh. That would be real sad.

I could understand TXP 4.6 won’t go that far as requiring PHP 5.3.0 but I do hope a future version will up the minimum requirement. There are a couple of good things that would be possible, I think.

The current Textile version included with 4.6-dev doesn’t really matter, since it isn’t meant for production.

Eh, it runs a website on my local network, and some testing & playing grounds as well.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#6 2013-11-05 12:30:08

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Blockquotes the HTML5 way, a little surprised

phiw13 wrote:

I could understand TXP 4.6 won’t go that far as requiring PHP 5.3.0 but I do hope a future version will up the minimum requirement. There are a couple of good things that would be possible, I think.

I would want to jump to PHP 5.3.0 too. Reasons like these. World is moving on and stuff just has moved past PHP 5.2.0.

Offline

#7 2013-11-05 12:58:40

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [textile] Blockquotes the HTML5 way, a little surprised

I’d be happy for Textpattern 4.6 to require PHP5.3 minimum, it’s a fair ways off from release yet anyhow.

Offline

#8 2013-11-05 15:01:42

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: [textile] Blockquotes the HTML5 way, a little surprised

You could simply replace your ./textpattern/lib/classTextile.php file with the 2.5.3 version of classTextile.php from Github. This is the most recent incarnation of Textile in the 2.5 branch. Then your example can be written as:

bq..:http://example.com/ Blockquote with footer (using @textile@)

Here is an example of a block quote. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
<footer>— "anonymous":http://example.com </footer>

and you would get this HTML output:

<blockquote cite="http://example.com/">
	<p>Blockquote with footer (using <code>textile</code>)</p>

	<p>Here is an example of a block quote. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <br />
<footer>— <a href="http://example.com">anonymous</a> </footer></p>
</blockquote>

Offline

#9 2013-11-05 23:46:29

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: [textile] Blockquotes the HTML5 way, a little surprised

ax wrote:

You could simply replace your ./textpattern/lib/classTextile.php file with the 2.5.3 version of classTextile.php from Github. This is the most recent incarnation of Textile in the 2.5 branch.

Oh, is it that simple? Perhaps I misread the instructions on Github. I’ll give it a try. Thanks.

<blockquote cite="http://example.com/">
	<p>Blockquote with footer (using <code>textile</code>)</p>

	<p>Here is an example of a block quote. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <br />
<footer>— <a href="http://example.com">anonymous</a> </footer></p>
</blockquote>

Right, that was the kind of output I was actually expecting originally, but that is invalid markup. footer cannot be a child of <p> (and adding additional line breaks in the textile input would only exacerbate the issue). Testing on TXP4.6dev gave me that something surprising output I noted in the original post above.

Using notextile. is the way to go ATM – not a particular problem for me, I could imagine it being a little bit (cough) challenging for some of my clients. I wonder if I could convince smd_macro to help them there.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#10 2015-11-04 09:42:24

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [textile] Blockquotes the HTML5 way, a little surprised

Any improvement planned on this? Using notextile. is not really friendly…


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#11 2015-11-04 10:14:34

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [textile] Blockquotes the HTML5 way, a little surprised

Well, Textpattern 4.6 now requires PHP 5.3.3 as a minimum, so maybe someone can sort this?

I have raised a topic in the core dev section to discuss further.

Offline

Board footer

Powered by FluxBB