4 votes

Borked up syntax highlighting (for a GitLab issue)

(1) This works okay:

typedef struct metres metres_t;

int       metres_get_value(metres_t *x);
metres_t *metres_add(metres_t *x, metres_t *y);
metres_t *metres_new(int value);
void      metres_delete(metres_t *x);

(2) This works badly:

  • typedef struct metres metres_t;
    

    int metres_get_value(metres_t *x);
    metres_t *metres_add(metres_t *x, metres_t *y);
    metres_t *metres_new(int value);
    void metres_delete(metres_t *x);

(3) This works slightly better, but the list bullet is weird:

  • typedef struct metres metres_t;
    
    int       metres_get_value(metres_t *x);
    metres_t *metres_add(metres_t *x, metres_t *y);
    metres_t *metres_new(int value);
    void      metres_delete(metres_t *x);
    

5 comments

  1. [4]
    Deimos
    (edited )
    Link
    Seems to be doable with markdown by indenting a code block starting on the next line after a list marker (but gets used to get the same weird bottom-aligned list bullet): * ```c typedef struct...

    Seems to be doable with markdown by indenting a code block starting on the next line after a list marker (but gets used to get the same weird bottom-aligned list bullet):

    *
        ```c
        typedef struct metres metres_t;
    
        int       metres_get_value(metres_t *x);
        metres_t *metres_add(metres_t *x, metres_t *y);
        metres_t *metres_new(int value);
        void      metres_delete(metres_t *x);
        ```
    

    Result:

    • typedef struct metres metres_t;
      
      int       metres_get_value(metres_t *x);
      metres_t *metres_add(metres_t *x, metres_t *y);
      metres_t *metres_new(int value);
      void      metres_delete(metres_t *x);
      
    3 votes
    1. [3]
      unknown user
      Link Parent
      I see what you did there :-) ! And thank you.
      2 votes
      1. [2]
        Deimos
        (edited )
        Link Parent
        Yeah, that fixes the strange bullet alignment. I'm still not sure what's going on with example #2 though, it mangles the HTML in a weird way. Edit: if anyone happens on this through the site, I...

        Yeah, that fixes the strange bullet alignment. I'm still not sure what's going on with example #2 though, it mangles the HTML in a weird way.

        Edit: if anyone happens on this through the site, I posted an explanation about example #2 in the GitLab issue: https://gitlab.com/tildes/tildes/issues/604#note_249337331

        2 votes
        1. unknown user
          Link Parent
          Ah, the Mysterious Magical Mannerisms of Markdown Mark-up. Thanks again.

          Ah, the Mysterious Magical Mannerisms of Markdown Mark-up. Thanks again.

          2 votes