• Resolved ronisbr

    (@ronisbr)


    Hi!

    I tried to add support to plain text files using add_filter() but I could not. How can I do this? What I want is just display the code without any highlights.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author maximebj

    (@maximebj)

    I’m looking here:

    https://codemirror.net/mode/

    but there is no plain text (maybe I juste have to load nothing ?)
    What do you need to display?

    Would shell be ok ?

    Or else try this :

    
    function my_custom_languages( $languages ) {
        $languages[] = array('slug' => 'plain', mode => '', 'label' => 'Plain text') ;
    
        return $languages;
    }
    add_filters( 'advanced_gutenberg_blocks_code_languages', 'my_custom_languages' ); 
    

    Tell me if it works

    Thread Starter ronisbr

    (@ronisbr)

    Just the output of a script. Just something without colors at all, using the base theme. Shell will not be good because random words will be highlighted. I will try you code today and I will let you know if this works!

    Thanks!

    Plugin Author maximebj

    (@maximebj)

    by the way it’s add_filter without s ??

    I’ve tried and it works. You won’t need to do anything because I’ll add it in the next release (later today) so you’ll be able to select Plain text in the default languages list.

    Thanks for the idea

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add support to plain text files’ is closed to new replies.