我有一個小型web應用程序,最終輸出html和css代碼,但它需要重新輸入,尤其是css。我發現這個庫:https://github.com/beautify-web/js-beautify 但它似乎並沒有工作。例如,其中一個文件說:使用Javascript縮進HTML和CSScode
Usage:
style_html(html_source);
style_html(html_source, options);
但我得到的只是一個錯誤:style_html未定義。我已經包含了一組腳本標記,正如它在使用部分中所述。
例如:
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.8/beautify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.8/beautify-css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.8/beautify-html.min.js"></script>
<script> style_html("asdf");</script>
什麼想法?
請提供一個最小,完整和可驗證的示例:http://stackoverflow.com/help/mcve – Connum