From: Jean Privat Date: Thu, 23 Jun 2016 18:07:24 +0000 (-0400) Subject: nitlight_aas: move up hightlightcode X-Git-Url: http://nitlanguage.org?hp=4f557eaee79cde242944a61ab9cb09222cf8d7ad nitlight_aas: move up hightlightcode Signed-off-by: Jean Privat --- diff --git a/src/examples/nitlight_as_a_service.nit b/src/examples/nitlight_as_a_service.nit index 7e68dc9..bcc059d 100644 --- a/src/examples/nitlight_as_a_service.nit +++ b/src/examples/nitlight_as_a_service.nit @@ -88,7 +88,11 @@ class HighlightAction do var hl = new HighlightVisitor var page = new Template + + # There is code? Process it var code = http_request.post_args.get_or_null("code") + var hlcode = null + if code != null then hlcode = hightlightcode(hl, code) page.add """ {{{hl.head_content}}} @@ -103,10 +107,7 @@ class HighlightAction

""" - if code != null then - # There is code? Process it - var hlcode = hightlightcode(hl, code) - + if hlcode != null then # Inject highlight page.add "
"
 			page.add hl.html.write_to_string