• Resolved meideserve

    (@meideserve)


    Some of my headings (eg heading 2, heading 3), use punctuation for good reading!

    Blog readers like to see exclamation marks, or comma sometimes.

    However, the Easy TOC does not work when any headings contain punctuations.

    This is likely because HTML anchors do not support it. Is there an easy fix to this? (other than manually changing the HTML anchors / omitting punctuation – which is very tedious for blog with MANY posts…)???

    Thank you!

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter meideserve

    (@meideserve)

    // Reserved Characters.
    //* ‘ ( ) ; : @ & = + $ , / ? # [ ]
    $return = str_replace(
    array( ‘*’, ‘\”, ‘(‘, ‘)’, ‘;’, ‘@’, ‘&’, ‘=’, ‘+’, ‘$’, ‘,’, ‘/’, ‘?’, ‘#’, ‘[‘, ‘]’ ),
    ”,
    $return);

    How about:
    ! % ^ ~ ` { } : ” ‘ .

    Steven

    (@shazahm1hotmailcom)

    RE: updated to 2.0.15 easy TOC… but the problem* still persists? how come?

    I looked at this page:

    This link is in the TOC:

    Notice the ? is being removed.

    RE: 2. Find this phrase “For example, learn about what meide.sg covers for window cleaning here. ”
    3. Look at the link address for the word “here” specifically.
    4. it should say https://meide.sg/what/#window
    5. click on it – and although it goes to the link… both smooth scroll and offset are not working.

    Sorry, this has nothing to do with ezTOC. That is a link created in the page paragraph to a section on another page. ezTOC is not/cannot do smooth scrolling for you in this context. It will only function when clicking from a TOC to a heading within the same page.

    RE: there are special characters still present in headings / easy TOC headings.

    Where?

    Steven

    (@shazahm1hotmailcom)

    RE: How about: ! % ^ ~ ` { } : ” ‘ .</strong>

    Please put all these character in a heading, like so:

    <h1>Characters ! % ^ ~ { } : ” ‘ ” ‘ .</h1>`

    View the resulting link in the page source.

    Steven

    (@shazahm1hotmailcom)

    Darn, the forum messed up my last reply, But I think you’ll get the idea.

    Thread Starter meideserve

    (@meideserve)

    Yep Steven! Understood. Sorry about that… I am too focused on the overall functionality.

    But perhaps more reserved or special characters need to be considered:
    as per my latest previous comment:
    How about:
    ! % ^ ~ ` { } : ” ‘ .

    ???

    https://staging10.meide.sg/avoid-during-cny/#Do_Not_Use_Sharp_Objects_Like_Scissors_Or_Knives!

    https://staging10.meide.sg/avoid-during-cny

    – i think once all these remaining characters are added, there should not be any more problems, or conflicts with my own script, or page scroll to id plugin.

    Steven

    (@shazahm1hotmailcom)

    RE: perhaps more reserved or special characters need to be considered:

    Please see my last two replies.

    Thread Starter meideserve

    (@meideserve)

    I went ahead to try and add the exclamation to the php file under includes… manually myself… and it solved the problem!!!

    I think there are more special characters to be added. I will add them myself, and then disable my own script, and use page scroll to id.

    btw incidentally I found one more special character need to be included:

    this is different from –

    again: – v.s. – (u can see the former is longer. i don’t know how to type it. i just copy and pasted from the heading wp generated).

    apparently it is generated by wordpress automatically when typing blog post.

    Steven

    (@shazahm1hotmailcom)

    The n-dash and m-dashes are also dealt with as they are encoded.

    Thread Starter meideserve

    (@meideserve)

    oh haha, thank you! gleaning new knowledge!!
    would you update the plugin to include all those extra characters?

    i trying to add myself, but i realized it may be over written if i update your plugin in future…

    // – (note that this is not – ) ! % ^ ~ ` { } : ” ‘ .
    $return = str_replace(
    array( ‘*’,’\”, ‘(‘, ‘)’, ‘;’, ‘@’, ‘&’, ‘=’, ‘+’, ‘$’, ‘,’, ‘/’, ‘?’, ‘#’, ‘[‘, ‘]’,’!’,’–’,’%’,’^’,’~’,’`’),
    ”,
    $return
    );

Viewing 9 replies - 16 through 24 (of 24 total)

The topic ‘NOT working with punctuation’ is closed to new replies.