dcat-admin icon indicating copy to clipboard operation
dcat-admin copied to clipboard

Markdown Editor set language and options globally or locally has no effect, it's not working

Open jay2success opened this issue 3 years ago • 1 comments

  • Laravel Version: 8.26
  • PHP Version: 7.4.6
  • Dcat Admin Version: 20.0.23

Description:

Markdown can't change language and options. Language set to English and still showing Chinese. Set Options has no effect, either globally (via bootstrap) or locally (via controller)

Steps To Reproduce:

Via controller: $form->markdown('html_template') ->languageUrl(admin_asset('@admin/dcat/plugins/editor-md/languages/en.js')) ->options([ 'language' => 'en', 'height' => 800, 'codeFold' => true, 'saveHTMLToTextarea' => true, 'searchReplace' => true, 'emoji' => false, 'taskList' => false, 'tocm' => false, 'tex' => false, 'flowChart' => false, 'sequenceDiagram' => false, 'imageUpload' => true, 'autoFocus' => true, ]) ->required();

Global Via bootstrap.php: Markdown::resolving(function (Markdown $markdown) { $markdown->options([ 'language' => 'en', 'height' => 800, 'codeFold' => true, 'saveHTMLToTextarea' => true, 'searchReplace' => true, 'emoji' => false, 'taskList' => false, 'tocm' => false, 'tex' => false, 'flowChart' => false, 'sequenceDiagram' => false, 'imageUpload' => true, 'autoFocus' => true, ]); });

jay2success avatar May 07 '21 10:05 jay2success

After further test, the options not working only if it's inside the form Multi line layout (row). The language still not working though, it's always showing Chinese language.

$form->row(function (Form\Row $row) use ($form) { $row->markdown('html_template') ->languageUrl(admin_asset('@admin/dcat/plugins/editor-md/languages/en.js')) ->options([ 'language' => 'en', 'height' => 800, 'codeFold' => true, 'saveHTMLToTextarea' => true, 'searchReplace' => true, 'emoji' => false, 'taskList' => false, 'tocm' => false, 'tex' => false, 'flowChart' => false, 'sequenceDiagram' => false, 'imageUpload' => true, 'autoFocus' => true, ]) ->required(); });

jay2success avatar May 07 '21 11:05 jay2success