Jaldhar H. Vyas wrote: > Hello, the enclosed patch allows the map plugin to use fields from the > meta plugin instead of the page name as the list item text. By default, > the meta title will be used but a different field can be used by > specifying the key parameter. E.g. > > [[map pages="*" key="description"]] > > and > > [[meta title="Serious article" description="PANCAKES!"]] > > would render PANCAKES! as the link text.
AFAICS, that would only work if 'description' were a defined metadata field, which it is not. > The only dodgy bit you might want to reject is the line where I use > HTML::Entities::decode. The problem is that the meta plugin already > encodes fields that contain unicode characters. So when I try and use > Devanagari text as the link text I get e.g. > > जैमिनि > > instead of: > > ?????????????????? > > HTML::Entities::decode works for me but I don't know if it is the best > approach. What do you think? It's a bit of a mess, since meta title is encoded numerically, but the other metadata stored in pagestate by meta is not html-encoded at all. I also don't quite understand why you need to decode entities.. The generated html would be: <a href="foo">जैमिनि</a> Which seems perfectly valid to me; renders in epiphany as: जैमिनि That's the correct rendering isn't it? And if you decode the title, and it contained encoded < and >, that would be a problem.. More generally, the values stored in pagestate by meta don't have any consistency of intended use. The license and copyright can include arbitrary html markup such as hyperlinks; the title cannot. So using key="license" or something like that could cause it to generate a link inside a link (ie, invalid html). I doubt you'd want to use key=license,copyright, or author anyway; it seems unlikely to be useful. I'm leaning toward using [[map pages="*" show=title]], and special case each possible value of "show". Starting probably, with just supporting show=title. -- see shy jo
signature.asc
Description: Digital signature