• Hi there,

    I was wondering if there was a good way to pass this plugin an option to parse additional, custom markdown to render a specific markup?

    Below is an example with an arbitrary syntax (which might be terrible, just bear with me).
    Say I want to create a figure block with a figcaption, and I come up with this custom syntax:
    {[Some alt text](https://example.com/image.jpg)[A good image caption]}
    … that would get converted into this:
    <figure><img src="https://example.com/image.jpg" alt="Some alt text"><figcaption>A good image caption</figcaption></figure>

    Would this plugin be able to accommodate for this, and if so, how would I implement that conversion? (I would create a small custom plugin to run a regular expression on the content and convert it, of course, I just wonder if there is a filter I can hook into)

    Thank you!

    Best,
    Chris

    PS: I know I could pass in the final HTML directly, but that is less convenient, and harder to scan.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Terry L.

    (@terrylin)

    Hello.

    I think I can add it as a new feature for you.
    But I think your custom syntax might be a bit complex.

    The original Markdown syntax for images looks like this:

    ![Alt text](https://example.com/image.jpg "Optional title")

    Maybe the following code would be better:

    %[Alt text](https://example.com/image.jpg "Optional title")

    Just change the ! to %

    Hey @terrylin, thanks for getting back to me!

    I was just using it as an example but you’re right, that looks like a good option. ??

    I think it would be great to have that kind of feature, but maybe that beats the purpose of the simplicity of markdown – please let me know if I can help/assist in any way.

    Best,
    Chris

    Plugin Author Terry L.

    (@terrylin)

    Okay! I will add it in vacation, any update I will metion you here.
    Have a good day!

    Thank you @terrylin! I truly appreciate it. ??

    Plugin Author Terry L.

    (@terrylin)

    @jakhris

    I have just updated WP Githuber MD to version 1.5.2, you can checkout example here:
    https://github.com/terrylinooo/githuber-md/issues/8

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Parse custom syntax block support?’ is closed to new replies.