Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2012-04-22 19:48:07
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Links with umlauts don't work
An update on this subject.
It should already be possible to include Japanese style links using the unmodified master branch of the code. The trick is to use the link reference syntax, rather than inline links. Something like this…
...blah blah "福島駅":refname blah blah...
[refname]http://ja.wikipedia.org/wiki/福島駅_(大阪府)/
…should work just fine — even with the trailing slash.
— Steve
Offline
Re: [textile] Links with umlauts don't work
net-carver wrote:
It should already be possible to include Japanese style links using the unmodified master branch of the code. The trick is to use the link reference syntax, rather than inline links.
I’m confused – by unmodified master branch, do you mean Textile 2.3.2 ? If so, including those Japanese links works directly, as long as your (surrounding) text is either in roman characters, or if the surrounding text is Japanese (CJK, actually), your link is surrounded by spaces. Your suggestion to use link reference works as well; but again, with the limit that spaces must surround the link.
For purely Japanese text – where those spaces look real weird, the workaround I found is to have the links in footnotes. Like so:
福島県(ふくしまけん)は、東北地方[1]南部(南東北)にある県。県庁所在地は福島市。太平洋に面し、奥羽山脈の東西にまたがって存在する。
fn1. "東北地方":refname2
It is certainly not perfect, as footnotes in Japanese are usually marked as [※ 1] and not [1], but it makes adding links to a text more manageable, esp on an iPhone…
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
#27 2012-04-23 10:58:43
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Links with umlauts don't work
Hi Philippe
phiw13 wrote:
I’m confused – by unmodified master branch, do you mean Textile 2.3.2?
Yes.
If so, including those Japanese links works directly, as long as your (surrounding) text is either in roman characters, or if the surrounding text is Japanese (CJK, actually), your link is surrounded by spaces.
Right, but it doesn’t work with a trailing /
— which is the subject of the post that I was self-replying to. However, this does work correctly with link references.
For purely Japanese text – where those spaces look real weird, the workaround I found is to have the links in footnotes. Like so:
福島県(ふくしまけん)は、東北地方[1]南部(南東北)にある県。県庁所在地は福島市。太平洋に面し、奥羽山脈の東西にまたがって存在する。
1 東北地方
It is certainly not perfect, as footnotes in Japanese are usually marked as [※ 1] and not [1], but it makes adding links to a text more manageable, esp on an iPhone…
Ok, out of curiosity, does that [※ 1] appear just in the text, or just in the footer, or in both?
— Steve
Offline
Re: [textile] Links with umlauts don't work
net-carver wrote:
Ok, out of curiosity, does that [※ 1] appear just in the text, or just in the footer, or in both?
Not as rule, I don’t think so. But scrolling through my references, I see now that the W3C’s Req. for Japanese Text Layout suggest the use of (1) instead of [※ 1] (the latter is something I do often see, though, it is even in my grammar book).
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
#29 2012-04-23 23:26:58
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Links with umlauts don't work
Hello Philippe,
the link you posted was interesting and has prompted the custom footnote format. It’s currently an experiment but you may find useful. The commit note explains how to get links like (1) out of textile.
— Steve
Offline
Re: [textile] Links with umlauts don't work
net-carver wrote:
the link you posted was interesting and has prompted the custom footnote format. It’s currently an experiment but you may find useful. The commit note explains how to get links like (1) out of textile.
Oh, that looks mightily interesting :-). me will play a little with this later today or so. Not only for Japanese, I can picture me using this for other languages as well.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
#31 2012-04-27 12:35:52
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Links with umlauts don't work
Philippe
Let me know if this is a suitable fix for Japanese (and other) footnote markers. If so I’ll look at getting this merged into the master branch.
— Steve
Offline
Re: [textile] Links with umlauts don't work
net-carver wrote:
Let me know if this is a suitable fix for Japanese (and other) footnote markers. If so I’ll look at getting this merged into the master branch.
Yeah, I meant to investigate this further, but I ran into this error when trying to save an article (and trying to get this to work):
internal_error "Undefined variable: atts"
in /Users/phiw/Sites/_emps/textpattern/lib/classTextile.php at line 1221
textpattern/lib/classTextile.php:1221 adminErrorHandler()
Textile->fNoteLists()
textpattern/lib/classTextile.php:1198 preg_replace_callback()
textpattern/lib/classTextile.php:510 Textile->placeNoteLists()
textpattern/include/txp_article.php:1114 Textile->TextileThis()
I don’t know exactly what I was trying (what input I had), though, and, as said, I haven’t gotten to investigate it.
Can you post an example (input) that works on your side?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
#33 2012-04-27 14:36:13
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Links with umlauts don't work
Hi Philippe,
thank you for testing, that’s exactly the kind of report I need. A few questions…
1) Were you using classTextile.php file from the custom-footnote-markers branch?
2) Had you done…
@define('txt_fn_ref_pattern', '<span{atts}>({marker})</span>');
@define('txt_fn_foot_pattern', '<span{atts}>({marker})</span>');
…before classTextile.php was being loaded?
3) Is there anyway you can get that article text over to me to test?
Thank you!
— Steve
Offline
Re: [textile] Links with umlauts don't work
Steve,
Yes and yes to questions 1 and 2, not the question 3, that why I said I need to investigate what I did (i had overwritten the art. with other attempts…).
btw something that does work (now ? A clean test article maybe ?) (with your patch) is
xxx[1]xxxxx
fn1. "xxx":url here
that generates
xxx(1)xxxxx
(1)"xxx" as linked text
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online
#35 2012-04-27 15:10:20
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [textile] Links with umlauts don't work
phiw13 wrote:
Yes and yes to questions 1 and 2, not the question 3, that why I said I need to investigate what I did (i had overwritten the art. with other attempts…).
From the error message looks like something in the notelist code is causing the problem.
btw something that does work (now ? A clean test article maybe ?) (with your patch) is
xxx[1]xxxxx
fn1. "xxx":url here
that generates
xxx(1)xxxxx
(1)"xxx" as linked text
Right, that’s exactly the output I was expecting from that branch. Now I know which branch you are using I can start tracking down that error.
— Steve
Offline
Re: [textile] Links with umlauts don't work
net-carver wrote:
From the error message looks like something in the notelist code is causing the problem.
Now that you mention notelist, yes I think I (still) had that included in that test article (like this: notelist(myclass#myid)+.
). I think it was included at the end of the article.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Online