Skip to content

How to wrap images in a HTML figure element? #374

Discussion options

You must be logged in to vote

Here's a example extension file system/extensions/picture.php. It generates a HTML figure element both as block-level element and as inline element. You can adapt the code to your needs, make it your own. The API and the new shortcut handler give you control over the generated output. See also #392.

<?php
// Picture extension, experimental

class YellowPicture {
    const VERSION = "0.8.20";
    public $yellow;         // access to API
    
    // Handle initialisation
    public function onLoad($yellow) {
        $this->yellow = $yellow;
    }

    // Handle page content of shortcut
    public function onParseContentShortcut($page, $name, $text, $type) {
        $output = null;
        if (

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by annaesvensson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #374 on December 27, 2020 13:42.