From 03bdf63ce4af27e480f5b361ae638d04708173cc Mon Sep 17 00:00:00 2001 From: Dave Follett Date: Mon, 21 Jan 2019 17:39:09 -0500 Subject: [PATCH] Added the 'initalpath' and 'module' options to the codesandbox embed (#1545) * Added the 'initalpath' and 'module' options to the codesandbox embed and updated the help page. * Fixed spelling errors. * Rework from previous PR: Improved exception text. Improved regex for detecting invalid options. Changed logic to raise an exception if any invalid options are found by moving the exception raising to be inside the valid_option() method. * Added unit tests for codesandbox_tag.rb. --- app/liquid_tags/codesandbox_tag.rb | 39 ++++++++++--- app/views/pages/_editor_guide_text.html.erb | 12 ++++ spec/liquid_tags/codesandbox_tag_spec.rb | 62 +++++++++++++++++++++ 3 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 spec/liquid_tags/codesandbox_tag_spec.rb diff --git a/app/liquid_tags/codesandbox_tag.rb b/app/liquid_tags/codesandbox_tag.rb index a2cd02485..3d4145a7b 100644 --- a/app/liquid_tags/codesandbox_tag.rb +++ b/app/liquid_tags/codesandbox_tag.rb @@ -2,30 +2,53 @@ class CodesandboxTag < LiquidTagBase def initialize(tag_name, id, tokens) super @id = parse_id(id) + @query = parse_options(id) end def render(_context) - '