I'm using the Github API to make a request to get the diff between 2 commits. I'm using the diff media type and getting the diff back as a string. This is all working fine, except now I'm challenged with having to display this diff on the web UI that I'm building (its in Ember). The desired outcome is to have additions colored in green and deletions shown in red. I'm guessing if there's no existing libraries or addons that do this, I might need to do some regex looking for +'s and -'s and then applying styles dynamically to the matched substrings, but that seems like a shakey idea (what if there are + or - in the code itself?).
Has anyone tackled this before? I don't know if I haven't found the right search term, but I can't seem to find any information on how to do this.
Aucun commentaire:
Enregistrer un commentaire