Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-12 12:17:32

ultramega
Member
Registered: 2006-02-26
Posts: 221

[textile] Textile dashes, mysql-replace

I have two question about dashes:

Is it possible with Textile to produce en-dashes (second longest) without spaces around it?

-

These are the variations what I can get now with Textile:

with hyphen:
1-1

en-dash with spaces:
1 – 1

em-dash without spaces:
1—1

em dash with spaces:
1 — 1

Where is the missing en-dash without spaces, here achieved with copy-paste: 1–1?

Other question is about replacing wrong dashes in db. How (easily please, I’m a quite mysql-noob) should I search and replace all situations where these marks have been used wrong, and replace them with correct ones? Like “where 1-1 -> replace it to 1–1”, “where 2-1 -> replace it to 2–1” etc…

I have got text’s from multiple sources, so there is different ways people have used them. I’d like to correct them all to be same.

Last edited by ultramega (2008-03-12 12:18:19)

Offline

#2 2008-03-16 13:50:04

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: [textile] Textile dashes, mysql-replace

Looking at classTextile.php it doesn’t seem so. There is no way for Textile to tell the difference between hyphens and en-dash, unless as you’ve found, you copy and paste them.

As for replacing en-dash already in the DB you’re going to hit the same problem. You could replace them all at once but it will also replace all the hyphens. Or if your using Textile with Textpattern you could do:

UPDATE `textpattern` SET Body_html = REPLACE(Body_html, ' &#8211 ', '&#8211');

to update the articles’ cached HTML but when you save the articles again the cache will get resaved.

Last edited by graeme (2008-03-16 13:51:50)

Offline

#3 2008-03-17 07:32:22

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: [textile] Textile dashes, mysql-replace

Ok, thanks for information. I think founding them would not be fully impossible, because they should mainly be replaced between two numbers, like 100-200.

Offline

Board footer

Powered by FluxBB