1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

Update topic names with '_' when editing content

For topics which are directories, name starts with an  '_'
This commit is contained in:
Apoorv Anand
2018-01-07 01:04:49 +05:30
committed by GitHub
parent f9d8edd6cc
commit 43682deca0
+3
View File
@@ -584,6 +584,9 @@ def cheat_wrapper(query, request_options=None, html=False):
edit_button = ''
if editable:
# It's possible that topic directory starts with omited underscore
if '/' in topic:
topic = '_' + topic
edit_page_link = 'https://github.com/chubin/cheat.sheets/edit/master/sheets/' + topic
edit_button = '<pre style="position:absolute;padding-left:40em;overflow:visible;height:0;">[<a href="%s" style="color:cyan">edit</a>]</pre>' % edit_page_link
result = re.sub("<pre>", edit_button + form_html + "<pre>", result)