Re: single apostrophe's ruining external linking
by merlyn (Sage) on Dec 31, 2007 at 20:16 UTC
|
That's not legal HTML. First, get into the habit of quoting your attributes, so that would be something like <a href=" ... ">. Then, recognize what characters need to be HTML-entitized. And actually, in that case, since single quote in a double-quote attribute value is safe, you might not need to change anything.
Oh, and this isn't Perl related at all. It's an HTML issue, so check sites like http://htmlhelp.com and such.
| [reply] [d/l] |
Re: single apostrophe's ruining external linking (match)
by tye (Sage) on Dec 31, 2007 at 20:27 UTC
|
<a href="http://www.nationmaster.com/encyclopedia/Formulation-of-Maxwe
+ll's-equations-in-special-relativity">this link</a>
produces this link.
[http://www.nationmaster.com/encyclopedia/Formulation-of-Maxwell's-equ
+ations-in-special-relativity|that link]
produces that link.
Unmatched quotes in HTML attributes are currently rejected as too troublesome to try to DWYM.
Note that either URL-escaping or HTML-escaping works in HTML links (as per the standard) so <a href="http://www.google.com/search?q="vu do%22">"vu do"</a> produces "vu do". Neither type of escaping currently work in [http://...] links but that is likely to change eventually (update: oh, URL escaping works in this case but not in other link types; HTML escaping doesn't work).
| [reply] [d/l] [select] |
Re: single apostrophe's ruining external linking
by davis (Vicar) on Dec 31, 2007 at 20:16 UTC
|
Hiya,
Basically, use square brackets to create links on PerlMonks. Hopefully this link should work exactly as I expect; it was produced by this code:
[http://www.nationmaster.com/encyclopedia/Formulation-of-Maxwell's-equ
+ations-in-special-relativity|this link]
The pipe symbol separates the link target (your "href" bit) and the link name. So, to summarize, it's not the apostrophe, it's the linking syntax. Use the "preview" option.
Incidentally (because you mentioned apostrophes), you don't pluralize "apostrophe" by putting "apostrophe-s" on the end. The correct plural is "apostrophes".... Yes, I'm way, way too twitchy about that, and it's nothing to do with being stuck in on New Year's Eve by my lonesome... *sob*.
Happy New Year!
davis
Kids, you tried your hardest, and you failed miserably. The lesson is: Never try.
| [reply] [d/l] |
|
|
In the OP's title, "apostrophe's" doesn't mean plural, but "apostrophe is".
| [reply] |
|
|
| [reply] |
|
|
shmem thanks for sticking up for me. :-) but now that I think about it, is that a legal contraction? Like davis, I've been drinking. :-)
| [reply] |
|
|
Re: single apostrophe's ruining external linking
by shmem (Chancellor) on Dec 31, 2007 at 20:18 UTC
|
Try sprintf "%%%02x", ord "'" instead:
[http://www.nationmaster.com/encyclopedia/Formulation-of-Maxwell%27s-e
+quations-in-special-relativity|Maxwell's equation]
Maxwell's equation
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] [d/l] [select] |
Re: single apostrophe's ruining external linking
by zentara (Cardinal) on Jan 01, 2008 at 14:06 UTC
|
Thanks for edifying me everyone ... I definitely need to brush up on legal html (a New Years resolution I will probably never keep :-) ) , and to get into the habit of double quoting the link.
| [reply] |
|
|
Careful. The saying goes, that "the road to hell is paved with good resolutions"... ;)
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |
|
|
| [reply] |
|
|
Re: single apostrophe's ruining external linking
by Anonymous Monk on Jan 01, 2008 at 05:56 UTC
|
/me hands zentara a band aid for his buttocks :D | [reply] |