[dokuwiki] Re: pending patches?

  • From: Sander Tekelenburg <tekelenb@xxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 18 Jan 2007 22:22:50 +0100

At 14:53 +0100 UTC, on 2007-01-18, Werner Flamme wrote:

> Martin Tschofen schrieb am 18.01.2007 13:37:
>> Sander's idea works for most browsers (If I remember right IE has trouble
>> with it but I haven't checked IE7)

Ah, yes. Now that you mention i -- IE pre-7 doesn't recognise the :before and
:after pseudo elements, right? I haven't had a chance check IE 7, but if it
*still* doesn't...

>> if you use <q> and <blockquote> (which
>> are the semantically appropriate tags) to quote text in html. Then with css
>> you should be able to change the appearance of the quotes. If you're
>> thinking about using various different quote characters for the same
>> language, that wouldn't do it of course...martin

Well, that depends on what sort of variation you're thinking about. CSS
allows you to define different quote characters for each level of quotation.
If that's not what you mean to achieve, there's always <span class="blah">...

> I know that. But when the generated (X)HTMLcode has no special tags (like q
> or blockquote or cite or whatever) around the passages, I do not see what
> this css code helps for me.

Well, if the text in question is in fact a quote (and why else would you use
quote characters), the proper mark-up would be to use <q> or <blockquote>. If
you're saying those elements aren't there, then I'd say *that* is the problem.

I do recognise that Dokuwiki's inline editor doesn't offer buttons to
generate such mark-up, so you'd have to allow raw HTML to be entered. (Or
perhaps it can be done with markdown, which I believe Dokuwiki supports.)

[That aside, because I didn't quite understand which problem you're trying to
solve, I tried to keep my suggestion somewhat generic -- I mentioned <q> and
<blockquote>, but you can of course apply such CSS rules to other elements,
if you think it makes sense. I just meant to show that CSS can generate the
characters, per language, and per quote level.]

> And there are no special tags in the code where
> I want quotations marks *other than those provided by DWs renderer*.

I still don't understand to exactly what situation this applies. Is this a
character replacement function? Are we talking about manually entered quote
characters in the content, that Dokuwiki then replaces with other quote
characters? (In which case I assume the idea is to let people enter minute
and inch signs and have Dokuwiki convert them to quote characters, right?)

If that's what you're talking about, then indeed CSS won't do any good.

Still, IMO it would be better to not have hard-coded quote characters in your
content, but to instead enter proper mark-up, and leave the presentational
aspect to CSS. The reason for this is that user-agents can then apply the
proper quote characters themselves (through their built-in Style Sheet), and
users can override with whatever they consider to be correct quote
characters. After all, not everybody agrees on exactly which quote characters
are 'right' for a given language.

> DokuWiki inserts quotation marks into the (X)HTML code - in my mail to
> Sander I said where this happens. And I do not want those question marks

I assume that was just a typo, but if you really meant "question marks", I
can't follow what you mean here :)

> but some I think to be "nicer". And this is not possible (without changing
> the code) now, because the quotation marks are hardcoded inside DokuWiki. I
> want to have a variable instead of a constant, that's all.

Right. Proper mark-up wiould provide that.

> At the moment, I
> modified my template to replace the quotation marks:

[...]

Assuming my above assumptions about what you mean are correct, perhaps
something like this could work

$myhtml = str_replace('&ldquo;', '<q>', $myhtml);
$myhtml = str_replace('&rdquo;', '</q>', $myhtml);

(This, like your version, doesn't take the language into account though.)

The tricky bit of course is that you'd need to make sure to only apply this
to inline situations, and not to block level content. I'm not sure how you'd
do that. You'd need to have some other part of Dokuwiki's code for that.
Something that sanitizes entered content.

(OTOH, for blockquote Dokuwiki already offers syntax:
<http://wiki.splitbrain.org/wiki:syntax#quoting>. Given that, it might
perhaps be reasonable to assume that minute and inch characters are most
likely inline, and thus <q>. But I I'm just looking for arguments here,
without convincing myself ;))

[...]

>> On 1/18/07, Werner Flamme <werner.flamme@xxxxxx> wrote:

[...]

>>> I want to have other quotation marks than those inserted by the
>>> functions singlequoteopening, singlequoteclose, doublequoteopening and
>>> doublequoteclose in inc/renderer/xhtml.php.

Exactly when/why does Dokuwiki insert these characters? (I could go dig
through the source to find out, but that'd take more time ;)) Your use of
"insert" suggests that my earier assumption of "replacement" was incorrect?

[...]

>>> BTW, I read Esthers code as ("?" '?' / ??" ??' / "?" '?' / »?« ð?Ð / «?»
>>> Ð?ð / etc.), codepage windows-1252. They look different when using
>>> "charset=iso-8859-1" ;-)

Absolutely. Characters do not actually exist at this level. They are merely
numbers. By looking up those numbers in a table, the 'puter can display the
corresponding characters. That's why it is essential to always state which
table appies to the numbers (through a charset attribute, at least in the
case of http, mail and news). If you look up the same number in another
table, it'll refer to a different character (although in some cases tables
will overlap to some extend).


HTH


-- 
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: