Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting small tag #22

Closed
Rayaqu opened this issue Sep 9, 2023 · 4 comments
Closed

Conflicting small tag #22

Rayaqu opened this issue Sep 9, 2023 · 4 comments

Comments

@Rayaqu
Copy link

Rayaqu commented Sep 9, 2023

Hi. Thank you for making Mikio plugin, I find its use really helpful to organize my documents. However, I have been conflicted with a different plugin that implements HTML tags, specifically with the <small> tag. I intended to use this tag in a inline text, but Mikio plugin overrides this and forces the text in a new line. So in an attempt to personalize this, I found out that there are extra tags that aren't yet documented. In a quick look, apart from <small>, there's also <text> and <br> tags and I am liking the addition.

Is it possible to make <small> tag to optionally function as inline text?. As a workaround I was thinking in removing/renaming the small.php file, but will it break other Mikio plugin functions?

@nomadjimbob
Copy link
Owner

nomadjimbob commented Sep 10, 2023

Thanks for the comments. The small, text and br tags were added a while ago, I've just forgotten to update the docs. Sorry.

I will fix the small tag as it should be inline. In the meantime, you can update the file to:

class syntax_plugin_mikioplugin_small extends syntax_plugin_mikioplugin_core {
    public $tag                 = 'small';
    public $hasEndTag           = true;

    public function getPType() { return 'normal'; }
    
    public function render_lexer_enter(Doku_Renderer $renderer, $data) {
        $renderer->doc .= '<small class="' . $this->elemClass . ' ' . $this->classPrefix . 'small">';
    }


    public function render_lexer_exit(Doku_Renderer $renderer, $data) {
        $renderer->doc .= '</small>'; 
    }
}

The line public function getPType() { return 'normal'; } will make the tag inline (you may need to re-save the affected pages due to caching).

You can remove any of the files (except core.php) from inside the syntax folder and it shouldn't cause any issues.

Todo

  • Updated Documentation to include <small>, <text>, <br> tags
  • Updated small syntax to be inline
  • Pushed update to Dokuwiki

@nomadjimbob
Copy link
Owner

Fixed in the 2023-09-11 release. Added a new option file to disable individual tags in the plugin if found to be conflicting with other plugins or just don't want them to be available to users.

@Rayaqu
Copy link
Author

Rayaqu commented Sep 11, 2023

Thanks for updating so quicky!
So I updated the plugin and I was testing it and I get this error anywhere mikio plugin is used:
image

I disabled other plugins to test and it seems that <small> tag in Mikio Plugin does not render the contents. Also to test disabling functions in disabled-tags.php, I disabled <button> and <button-group> and they were still rendering xD

Edit: So, I rolled back to the previous version and applied your code for the small tag and it works flawlessly. It seems that the new function disabled-tags.php is the problem. Sorry, should have opened a new issue.

nomadjimbob added a commit that referenced this issue Sep 11, 2023
@nomadjimbob
Copy link
Owner

I have fixed the problem. There was a bug in my code and it appears that Dokuwiki does not call the disable code in some cases, so I've rewritten it and tested it.

Should be no problems now (hopefully)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants