Này người xa lạ!

Còn chờ gì nữa mà không mau đăng nhập hoặc đăng ký để cùng tham gia thảo luận với cộng đồng!

Markdown in the forum

You can now post Markdown in the forum. The forum is using PHP Markdown, which is different than what the main site uses, so there may be some differences.

Feel free to use this thread for testing, and let us know of any problems you encounter.

Bình luận

  • đã sửa September 2014

    This is great; now I can just type without doing the annory tags , and everything.

    alert(function () {
        return 'hello world';
    } ());
    
  • đã sửa September 2014

    @JasonBarnabe, Problem number 1!

    Code block inside ``` are parsed as code, was expecting pre.

    Another thing, can I set markdown as default when I want to type something?

  • It always defaults to HTML for new posts right now, but I intend to have a site-wide option for which markup you want to use.
  • đã sửa September 2014
    1. syntax highlighting
      syntax highlighting in fenced code blocks with language specifier would be nice. The doc says it's possible but I couldn't make it work neither via ``` nor ~~~.

      ~~~ javascript

      //code

      ~~~

      Guess a white/lightgray background would be necessary.

    2. pre
      the doc says to use ~~~ (three or more tildes on a separate line):
      some code
      
    3. tables
      need some padding and borders apparently:
      a b
      1 2
      3 4
  • If I quote woxxom in a html comment this is the result. If I quote in a markdown comment the result is worse. But I do get a warning either way: "The quote had to be converted from Markdown to Html. Some formatting may have been lost."
    * syntax highlighting syntax highlighting in fenced code blocks with language specifier would be nice. The doc says it's possible but I couldn't make it work neither via ``` nor ~~~.

    ~~~ javascript
    //code
    ~~~



    Guess a white background would be necessary.


    * pre the doc says to use ~~~ (three or more tildes on a separate line):

    some code


    * tables need some padding and borders apparently:

    a b 1 2 3 4
  • Just as a test, in case it was just a problem with the preview - here's a quote in a markdown comment:

    * syntax highlighting syntax highlighting in fenced code blocks with language specifier would be nice. The doc says it's possible but I couldn't make it work neither via ``` nor ~~~. ~~~ javascript //code ~~~ Guess a white background would be necessary. * pre the doc says to use ~~~ (three or more tildes on a separate line): some code * tables need some padding and borders apparently: a b 1 2 3 4
  • đã sửa September 2014

    I wonder if the quote button can be taught to preserve the original formatting, this would allow nested quotes. Markdown syntax allows that:

    Quote

    nested quote

    Quote

  • It looks like Vanilla includes a version of this library from 2009, without support for fenced code blocks and other stuff. I've asked if there's any reason for this.

    The newer version of the quoting plugin looks a bit better at handling different formats. I'm going to try it out once they fix something I reported...
  • đã sửa September 2014

    @JasonBarnabe, regarding tables: padding and borders are zeroed in the main style.css /* Reset CSS */ section. Some CSS rules should be added explicitly, maybe those github uses?

    github-table

    Here's another example of a fine free CSS:

    table-airy

    Below is my kinda lame attempt to make a 'greasyforkish' table, you may use or adapt it:

    tables

    .Message table {
       border-collapse: separate;
       border-spacing: 4px;
       margin: 1em -4px; /* -4px neutralizes the border-spacing on the outer borders */;
    }
    .Message th, .Message td {
       padding: 2px 1em;
    }
    .Message th {
       background-color: rgba(103,0,0,0.2);
       font-weight: bold;
       font-size: 105%;
       padding-top: 0.5em;
       padding-bottom: 0.5em;
    }
    .Message th:nth-child(odd) {
       background-color: rgba(103,0,0,0.15);
    }
    .Message tr:nth-child(even) td {
       background-color: rgba(0,0,0,0.05);
    }
    .Message tr:nth-child(even) td:nth-child(even) {
       background-color: rgba(50,0,0,0.08);
    }
    .Message tr:nth-child(odd) td:nth-child(even) {
       background-color: rgba(255,0,0,0.03);
    }
    
  • đã sửa September 2014
    Markdown quotes of html-formatted messages should escape with \ the characters that otherwise would be treated as format codes: *, _, # well, the entire gang, actually.
  • I've upgraded to the newest version of PHP Markdown, which I see gives fenced code blocks (but no syntax highlighting).
  • @wOxxOm I used your CSS for tables. Thanks!
  • Test multi-line backticks:
    foreach(foo as bar) { ... }

  • I've upgraded the Quotes plugin, which should make quoting someone who chose a different format suck less.
  • Test user name with a space:

    I've upgraded the Quotes plugin, which should make quoting someone who chose a different format suck less.

  • Sorry I post here is kind of a test for https://github.com/JasonBarnabe/greasyfork/issues/312 but at the same time I tried to find a topic in which I have something to say.

    Thanks for Markdown it’s my favourite !
    Could it be possible that the forum would remember my last choice (Markdown radio button) ?
    I know I could make a user script that would always auto-check that input[type='radio'][name='Format'][value='Markdown'], but it would rather be a nice genuine feature in the server code itself… :)

  • I've upgraded the Quotes plugin

    Nice, but... all the old quotes now aren't styled because they do not have class="Quote". Maybe it's possible to modify the css simply by adding , blockquote to the .Quote { rule?
  • jesus2099 nói:

    Could it be possible that the forum would remember my last choice (Markdown radio button) ?

    https://github.com/JasonBarnabe/greasyfork/issues/314
    wOxxOm nói:

    all the old quotes now aren't styled

    https://github.com/vanilla/addons/issues/152

  • đã sửa December 2014 Firefox

    So does it mean that we will wait for vanilla to fix it in some distant future or is it still possible to simply modify/duplicate the .Quote css to blockquote?

    blockquote {
        padding: 1ex 16px;
        margin: 1em 0;
        background: #f3f3f3;
        background: rgba(0, 0, 0, 0.05);
        border-left: 4px solid rgba(0, 0, 0, 0.1);
    }
    

    I've added this to my userstyle.

  • đã sửa December 2014 Firefox

    I intend to have a site-wide option for which markup you want to use.

    ...almost three months have passed filled with clicks to the option, it's hard to endure this anymore, so I've made a userscript that selects (*) markdown by default along with a few small features:

    image
Đăng nhập hoặc Đăng ký để gửi bình luận.