Skip to content

Commit

Permalink
Merge pull request #122 from lgessler/master
Browse files Browse the repository at this point in the history
revert commits that attempted to solve tokenization bug
amir-zeldes authored Jan 16, 2019
2 parents 3f1ce88 + e8a28b1 commit 91ff56c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions editor.py
Original file line number Diff line number Diff line change
@@ -249,6 +249,19 @@ def load_page(user,admin,theform):

text_content = generic_query("SELECT content FROM docs WHERE id=?",(doc_id,))[0][0]

# In the case of reloading after hitting 'save', either create new doc into db, or update db
# CodeMirror sends the form with its code content in it before 'save' so we just display it again
if theform.getvalue('code'):
text_content = theform.getvalue('code')
text_content = text_content.replace("\r","")
text_content = re.sub(r'&(?!amp;)',r'&',text_content) # Escape unescaped XML &
text_content = unicode(text_content.decode("utf8"))
if user != "demo":
if int(doc_id)>int(max_id):
create_document(doc_id, docname,corpus,status,assignee,repo_name,text_content)
else:
save_changes(doc_id,text_content)

git_status=False

commit_message = ""
@@ -305,19 +318,6 @@ def load_page(user,admin,theform):
resp = requests.post(api_call, data, auth=HTTPBasicAuth(nlp_user,nlp_password))
text_content=resp.text

# In the case of reloading after hitting 'save', either create new doc into db, or update db
# CodeMirror sends the form with its code content in it before 'save' so we just display it again
if theform.getvalue('code'):
text_content = theform.getvalue('code')
text_content = text_content.replace("\r","")
text_content = re.sub(r'&(?!amp;)',r'&',text_content) # Escape unescaped XML &
text_content = unicode(text_content.decode("utf8"))
if user != "demo":
if int(doc_id)>int(max_id):
create_document(doc_id, docname,corpus,status,assignee,repo_name,text_content)
else:
save_changes(doc_id,text_content)

# Editing options
# Docname
# Filename

0 comments on commit 91ff56c

Please sign in to comment.