htmlcssgitgitlist

Gitlist style git description


I installed gitlist on my developer server and i am trying to style the git description file of a git repository.
I tried to inject html code inside the description file but this is not recognized as html but as text.
After that, i tried to find and edit the php file of gitlist which is not allowing me to style the description file, but i didn't found something.
Is there anyone who could help me?

git-description-style http://dev.siggouroglou.gr/git-description-problem.png


Solution

  • From the GitList homepage:

    GitList is free and open source software, written in PHP, on top of Silex and the Twig template engine.

    Twig is often deployed with its escaper extension enabled, which is a relatively safe default setting. With this setting enabled, any text put into Twig templates will be escaped by default, e.g. HTML escaping will turn < into &lt;. This extension also supports JavaScript escaping.

    While this setting is enabled (and I recommend keeping it enabled), you can use the raw filter in templates to disable escaping of certain elements. This will require modifying the template code.

    Assuming your description is in a variable called description, something like this in the appropriate template should do the trick:

    {{ description|raw }}
    

    Note that permitting raw output does decrease your security. Make sure you trust your users not to put anything harmful into their repository descriptions.