|
Re: Cookbook coments: flexlayout printable-page smartquotes: msg#00154web.wiki.pmwiki.user
John Rankin wrote: 2 possible solutions: write 3.5[="=] or (better) 3.5″ (assuming that 3.5" means 3.5 inches) more generally: 6′ and 7″ -- Much bigger problem is that lines indented with one space often used to include source code snippets and other similiar information, and from my point of view it does not make any sense to process quotes in there. -- Depending on what else is in the line, you can again write [=source code snippet=] Well, I guess we have quite different points of view. You are suggesting to hold user responsible for markup, while my idea is that user should not worry about markup and everything should be done automatically. IMO your approach is the way to go for some serious markup languages, like book typesetting or html, but wiki was designed for putting some simple text on the web. From the very beginning wiki syntax had very limited markup capabilities, and the idea was to concetrate on content rather then presentation. So ideally smartquotes should take regular text and produce more or less nicely typesetted output. It might be not 100% accurate, but that's ok for the wiki. So my idea is without changing wiki syntax make resulting page nicer. I did something similiar once, and the approach I took was: we can devide all quotes on "opening" (i.e. space quote non-space) and "closing". Find first "opening" quote, and make it really opening, if next is opening make it <<, then close matching "closing" quotes. All "opening" and "closing" quotes that does are not in place replace with ". In this case "something "something else"" would be quoted properly, "something" 4" would be quoted properly as well. However "some 4" somethin" would be quoted incorrectly (as ``some 4' ' something" instead of ``some 4" something' ') . But how often would you encounter that? In this case user will have to use [="=] is s/he care. What is more important, is monospace text. AFAIK monospace font on the web (or in a book) is used to quote source code snippets, computer outputs, or commands user have to type in shell, or alike. In any of these cases there should not be done any typesetting. After all wiki engine treats monospace text differently -- every end-of-line is treated as <br> and so on. So even now typesetting is not applied to monospace text. Why should smartquotes be? Or let me put it this way: do you know any single case when user might want to use monospace font and smartquotes? That's the same problem as above. If you force users to write `-, how many people will do it? On the other hand if you will do /(\d)-(\d)/\1–\2/ how many dashes would be incorrectly converted to en dashes? I would say none.While it could easily render [0-9]\s*- as an en dash, it may be better to let people write (say) `- (backtick minus) and have this render as – (the alternative is -- for en dash and --- for em dash, but most people write -- when they mean em dash, so I don't think that's a good idea) That's interesting. Never heard of such interpretation of en dash :). What is in your opinion a correct symbol for minus? AFAIK in html there are three dashes -- hypen, en and em dash. If purpose of hyphen and em dash is quite clear, what is a purpose of en dash? My understanding was that it's a minus sign, and it is also appropriate to use it in telephone numbers, and dates (in some locales dash is a date delimiter).Thus one would write: the meeting is from 1`-3 (en dash) but half-baked for a normal hyphen. My understanding is that strictly, an en dash means 'to' so 1 en dash 3 means 1 to 3, whereas 1 - 3 means 1 minus 3. In any case, how many people writing wiki pages aware of all these tricky details? Suppose `- is the only way to create an en-dash, how many people will ever use it? I would argue that my approach will increase quality of the pages way more then yours. It still would not hurt having `-, so that those who want explicitely tell that something is en dash could do that, but \d-\d should take care of the bulk of en dashes. It already replaces << ... >> with left and right angle quote marks (&[lr]aquo;) -- the guillemet symbols. Are you suggesting it should also replace < ... > with &[lr]saquo; -- easily done. Not exactly, my suggestion was to convert "yadada "foobar" foo" to ``yadada <<foobar>> foo' ' automagically. It is quite tricky though, and does not happen that often. So I am fine with making users to explicetly write <<...>>. That also would be nice.And where does it stop? ... could becomes … so the dots never break across a line, and so on. That's all what I can think of from the top of my head.Are there other "obvious" smart things it should do? --Kirill |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Cookbook coments: smartquotes: 00154, John Rankin |
|---|---|
| Next by Date: | Re: Cookbook coments: smartquotes: 00154, Kirill Lapshin |
| Previous by Thread: | Re: Cookbook coments: flexlayout printable-page smartquotesi: 00154, John Rankin |
| Next by Thread: | Re: Cookbook coments: flexlayout printable-page smartquotes: 00154, John Rankin |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |