lxs24sxl / vite-plugin-html-env

A vite plugin for rewriting html
82 stars 10 forks source link

parser 逻辑不完备导致解析错误 #25

Open scott-avery opened 2 years ago

scott-avery commented 2 years ago
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta name="hash" content="<%=VITE_BUILD_HASH%>" />
    <link rel="apple-touch-icon" href="/logo192.png" />
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
    />
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/icon?family=Material+Icons"
    />
    <title>XXX</title>
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
    <!--
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the <body> tag.

      To begin the development, run `npm start` or `yarn start`.
      To create a production bundle, use `npm run build` or `yarn build`.
    -->
    <script type="module" src="/src/index.tsx"></script>
  </body>
</html>

解析到下面的注释节点内容时,错误地进行标签解析

lxs24sxl commented 2 years ago

Thanks for the feedback, I have solved this problem in version 1.2.7.