• Resolved Asadiyan

    (@asadiy4n)


    Hi
    The plugin does not work properly when using Persian or Arabic titles
    Is there a solution to this problem?
    To understand the problem, try the following text as a title

    <h2>من یک عنوان هستم</h2>

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Marc Toensing

    (@marcdk)

    Thank you for bringing that to my attention. Please try v4.1. Does this work?

    Plugin Author Marc Toensing

    (@marcdk)

    Feedback would be great. And a review if it works. =)

    Thread Starter Asadiyan

    (@asadiy4n)

    Thanks for your prompt reply
    I was thinking of making changes to the plugin, which fortunately you did well
    This issue was resolved with the update
    thank you

    Plugin Author Marc Toensing

    (@marcdk)

    Glad to here.

    Thread Starter Asadiyan

    (@asadiy4n)

    There is another problem
    I use the following code to get the target ID

    $(document).on('click', 'a[href^="#"]', function(e) {
    	var id = $(this).attr('href');
    	var $id = $(id);
    	if ($id.length === 0) { return; }
    	e.preventDefault();
    	var pos = $id.offset().top - 50 ;
    	$('body, html').animate({scrollTop: pos});
    });

    But if the href and target id is Persian, it will not work anymore
    It may be best to set a condition that the number be used for the element if it were not English letters
    somethings like

    
    <a href="toc-1">عنوان</a>
    <a href="toc-2">عنوان</a>
    <h2 id="toc-1">عنوان<h2>
    <h2 id="toc-2">عنوان<h2>

    Of course, this is a suggestion
    And maybe adding smooth scroll to ID will help make the plugin more advanced

    • This reply was modified 3 years, 3 months ago by Asadiyan.
    Plugin Author Marc Toensing

    (@marcdk)

    Ok. I think it might be better for the resulting urls to reflect the content of the anchor in the url.

    blabla.com/my-fav-games#dark-souls1

    is better than

    blabla.com/my-fav-games#toc-1

    That applies to Arabian language, too.

    And SimpleTOC is not AdvancedTOC. It’s simple. No JS, No CSS. There are other plugins that do that. SimpleTOC will remain simple. Especially in the frontend. Personally, I am annoyed by websites that override basic browser functionality like fast anchor tag links.

    You can count the elements in the toc and then jump to their corresponding headline if you really need to and use numbers yourself.

    • This reply was modified 3 years, 3 months ago by Marc Toensing.
    Plugin Author Marc Toensing

    (@marcdk)

    I think this topic is resolved. Feel free to open another one!

    Thread Starter Asadiyan

    (@asadiy4n)

    Thanks for the reply.
    Do you allow me to customize this plugin?
    I would like to ask your permission first, because of your copyright and your efforts

    Plugin Author Marc Toensing

    (@marcdk)

    It is on GitHub and here. Of course.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not working when using Persian or Arabic titles’ is closed to new replies.