1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Markdown Support

Discussion in 'Styling and Customization Questions' started by Rizwan Kassim, Mar 17, 2013.

  1. Rizwan Kassim

    Rizwan Kassim Member

    Is there anything we can do to assist or request Markdown Support in parallel with BBCode?
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    I don't believe there is an add-on for it, or any instructions on how to do it. However, you should be able to extend XenForo_BbCode_Parser::render($text, $extraStates) to call a Markdown parse renderer (into BB Code or straight HTML, HTML would most likely be better) and then send then call the internal render function. So...

    PHP:
    class MarkdownEditor extends XFCP_MarkdownEditor
    {
        public function 
    render($text, array $extraStates = array())
        {
            
    $text $this->_renderMarkdown($text);
            
            return 
    parent::render($text$extraStates);
        }
    }
     
  3. Fuhrmann

    Fuhrmann Well-Known Member

    Looks like the XenForo_BbCode_Parser is never called using the code event listener load_class_bb_code. How do I extend this class?
     
  4. cclaerhout

    cclaerhout Well-Known Member

    It's not possible. When the question has been asked, Kier said we shouldn't need to extend it. Actually we did ;)
     
    Fuhrmann likes this.
  5. PJK

    PJK Member

    What's the best way to get Markdown up and running in parallel with BBCode? Thanks.
     
  6. katsulynx

    katsulynx Well-Known Member

    Just finished my first attempt of a Markdown Implementation. You might want to check it out. (here)
     
    fromgate and PJK like this.
  7. PJK

    PJK Member

    Excellent, thanks. When do you estimate it will be stable? I'll give it a test here soon.
     
  8. katsulynx

    katsulynx Well-Known Member

    I'm not 100% happy with the implementation yet, but I'm a bit short on time until april 7th, so that's the earliest date I can continue
     

Share This Page