How to define comment syntax for a language

#254635
  • Resolved Penelope Samuel
    Rank Math free

    I’m having a difficult time finding a way to change the comment syntax for a Liquid file. Right now with the Liquid plugin installed when I CMD+/ I get a normal html comment like <!– –> when I’m really expecting a Liquid comment like {% comment %} {% endcomment %} . I’ve been searching for how to define the beginning and end of a comment for a language and different font styles from Anchor Fonts but haven’t been able to find it in the documentation.

    Ideally it would be nice to have single line and multiline selections formatted differently. If it’s possible to completely override the default HTML comments then I would do that since I only program in Liquid and never .html.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting the support, and sorry for any inconvenience that might have been caused due to that.

    I’m not quite sure whether I fully understand the question. But I’ll do my best and please let me know if I misunderstood.

    Mainly, WordPress is built with PHP whereas liquid is derived from Ruby. If you wish to comment something with PHP you might need to use this:

    Single Line: // your comment...
    Multi-line: /* your comment... */

    Unfortunately, we don’t have any custom filter to change how commenting works with Rank Math as we display the frontend elements with HTML comments.

    You can however remove Rank Math comments on the frontend by using this filter:

    /**
     * Filter to remove the plugin credit notice added to the source.
     *
     */
    add_filter( 'rank_math/frontend/remove_credit_notice', '__return_true' );

    https://rankmath.com/kb/filters-hooks-api-developer/#remove-plugin-credit-notice

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘How to define comment syntax for a language’ is closed to new replies.