Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
[SOLVED] Having trouble with the 'metadata' mode in my syntax plugin
Avatar
zioth #1
Member since Jul 2011 · 77 posts
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] Having trouble with the 'metadata' mode in my syntax plugin
A plugin I recently published, https://www.dokuwiki.org/plugin:autolink4 , has a bug. Links are rendered correctly (as plain text) in the abstract, but all links after the abstract are also appended. I've tried returning false in handle() or render(), but that just prevents the link text from being rendered at all. I also tried checking the length of $renderer->meta['description']['abstract'] against Doku_Renderer_metadata::ABSTRACT_MAX, but a lot of the time, the abstract isn't defined until after the end of the document.

Here's a simplified version of my render method:

    function render($mode, Doku_Renderer $renderer, $data) {
        if ($mode == 'xhtml') {
            $renderer->doc .= $data['the html version'];
        }
        else {
            $renderer->doc .= $data['the plaintext version'];
        }
        return true;
    }
This post was edited on 2018-12-20, 17:25 by zioth.
Avatar
zioth #2
Member since Jul 2011 · 77 posts
Group memberships: Members
Show profile · Link to this post
It looks like the real abstract gets cut off early (417 characters in one case, 285 in another), cutting off in the middle of sentences. Then extra links get appended until 500. What code determines when the abstract ends? I can't find anything outside of the cut-off in Doku_Renderer_metadata.
This post was edited on 2018-12-20, 17:23 by zioth.
Avatar
zioth #3
Member since Jul 2011 · 77 posts
Group memberships: Members
Show profile · Link to this post
Solved. I had to check for $renderer->capture .
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-01-17, 20:29:25 (UTC +01:00)