instance-oom / ngx-markdown-editor

Angular markdown editor based on ace editor
http://lon-yang.github.io/markdown-editor/
Apache License 2.0
174 stars 48 forks source link

Syntax highlighting and smart completion not working #150

Closed patui closed 9 months ago

patui commented 9 months ago

Importing ace.js through angular.json does not work properly, but importing it through the head element of html works fine. Is it convenient to check the problem?

            "styles": [
              "src/styles.css",
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/font-awesome/css/font-awesome.min.css",
              "node_modules/ngx-markdown-editor/assets/highlight.js/agate.min.css"
            ],
            "scripts": [
              "node_modules/ace-builds/src-min/ace.js",
              "node_modules/ngx-markdown-editor/assets/highlight.js/highlight.min.js",
              "node_modules/ngx-markdown-editor/assets/marked.min.js"
            ]

bug_01

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>NgEditor</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">

  <script src="https:////unpkg.com/ace-builds@latest/src-min/ace.js"></script>

</head>

normal

The only difference is the way to introduce ace.js

  "node_modules/ngx-markdown-editor/assets/marked.min.js"

<script src="https:////unpkg.com/ace-builds@latest/src-min/ace.js"></script>