Support » Plugin: Sectionize » [Plugin: Sectionize] id generation may produce illegal name or id

  • The code generationg the identifier (id) for the section may produce illegal or confusing name not starting with [a-z] and not followed by only allowed characters. Actually, when a title contains special chars like “élément” it makes use of RFC2396 %xy chars not allowed as identifiers.
    As stated in the (work in progress) regarding identifiers in HTML5 :
    IDs may follow sames rules as RFC2396 but it is not decided and is not actually handled nor by Firefox4 (see nor by Opera 11)

    As recalled in the HTML5 working drafts:
    “Identifiers are opaque strings. Particular meanings should not be derived from the value of the id attribute”

    Sectionize should not generate id from heading text but use sequence or random numbers.

    Thus I suggest the following approach using the existing counter in generating id :

    < $id = apply_filters(‘sectionize_id’, $id_prefix . $sanitizedTitle, $id_prefix, $headingText);

    > $id = apply_filters(‘sectionize_id’, $id_prefix . strval($i), $id_prefix, strval($i));

  • The topic ‘[Plugin: Sectionize] id generation may produce illegal name or id’ is closed to new replies.