HTML not being sanitized

Technical Support

Suggested Topics


  • How to tweak blockquote html?

    Solved Technical Support
    0 Votes
    9 Posts
    178 Views

    Well I have a solution. I haven't written code in years and Javascript in a decade so there may be bugs! 😆

    A preliminary question: action:composer.loaded offers the containing element, which allows one to find the text area directly. I wasn't able to do such a thing with action:composer.addQuote. I am wondering if there is a way to access the element directly, such as by importing <a module> into the custom Javascript...?

    Solution

    Basically I am using Javascript to pretty up the quote structure when a post is being written. I simply dump it in the "Custom Javascript" part of the admin. Within the composer, it moves the quote attribution into the quote itself and adds a newline if there are no nested quotes. The code uses a delay to edit the text in the composer 150 ms after action:composer.addQuote fires. The delay is necessary because it is possible to add quotes to an already-existing composer, and there is no addQuote parallel to action:composer.loaded.

    Editing the text within the composer allows previews to match what is seen on the site, but unfortunately this means that past posts will not be affected. There is also a function that removes nested quotes > 4-deep, which is only called on action:composer.loaded.

    If anyone wants the Javascript file they are welcome to it. I guess we can't upload files here?

    PrettyDeepQuotes.JPG

  • 2 Votes
    5 Posts
    339 Views

    Sorry for the delay. The hovering pagination block may not work as expected, but I think the pagination at the bottom of the page should work fine:

    image.png

  • 0 Votes
    5 Posts
    393 Views

    @pitaj Great! That's good to know!

  • 1 Votes
    12 Posts
    3k Views

    @julian Thank you. I will try that out. ☺

  • 0 Votes
    16 Posts
    4k Views

    Yes, it works fine in v1.0.2 🙂