From d460c4fe17cae68cee0c4efa3eeb8739ff72b1e7 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 23 Jun 2016 14:07:24 -0400 Subject: [PATCH] nitlight_aas: move up hightlightcode Signed-off-by: Jean Privat --- src/examples/nitlight_as_a_service.nit | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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
-- 
1.7.9.5