- <textarea id="html-editor" tinymce="editorOptions" mce-change="editorChange" mce-model="editorHtml" name="html" rows="5"
- @if($errors->has('html')) class="neg" @endif>@if(isset($model) || old('html')){{htmlspecialchars( old('html') ? old('html') : $model->html)}}@endif</textarea>
- @if($errors->has('html'))
- <div class="text-neg text-small">{{ $errors->first('html') }}</div>
+ @if(config('app.editor') === 'html')
+ <textarea id="html-editor" tinymce="editorOptions" mce-change="editorChange" mce-model="editContent" name="html" rows="5"
+ @if($errors->has('html')) class="neg" @endif>@if(isset($model) || old('html')){{htmlspecialchars( old('html') ? old('html') : $model->html)}}@endif</textarea>
+ @if($errors->has('html'))
+ <div class="text-neg text-small">{{ $errors->first('html') }}</div>
+ @endif
+ @endif
+
+ @if(config('app.editor') === 'markdown')
+ <div id="markdown-editor" class="flex-fill flex">
+
+ <div class="markdown-editor-wrap">
+ <textarea markdown-editor md-change="editorChange" md-model="editContent" name="markdown" rows="5"
+ @if($errors->has('markdown')) class="neg" @endif>@if(isset($model) || old('markdown')){{htmlspecialchars( old('markdown') ? old('markdown') : ($model->markdown === '' ? $model->html : $model->markdown))}}@endif</textarea>
+ </div>
+
+ <div class="markdown-display page-content" ng-bind-html="displayContent"></div>
+ </div>
+
+ <input type="hidden" name="html" ng-value="displayContent">
+
+ @if($errors->has('markdown'))
+ <div class="text-neg text-small">{{ $errors->first('markdown') }}</div>
+ @endif
+