Skip to content

Commit 1b9bd1a

Browse files
committed
Add explanation on why custom VanJS components are not supported in the UI version of VanJS code converter
1 parent 35ea75e commit 1b9bd1a

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

converter-lib.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h1 class="w3-padding-16 w3-xxxlarge">
7070
components: [],
7171
}
7272
*/
73-
</code></pre><h3 class="w3-large w3-text-red" id="using-vanjs-components"><a class="self-link" href="#using-vanjs-components">Using VanJS Components</a></h3><p><em>This is only supported in the converter library, not in the UI.</em></p><p>The input HTML string can be a mix of HTML elements and custom UI components built with <strong>VanJS</strong>. To use custom UI components, just specify the component similar to regular HTML tags. For instance, assume we have custom UI components similar to the ones shown in <a href="https://vanjs.org/" class="w3-hover-opacity">https://vanjs.org/</a> home page:</p><pre><code class="language-js">const Hello = text =&gt; div(
73+
</code></pre><h3 class="w3-large w3-text-red" id="using-vanjs-components"><a class="self-link" href="#using-vanjs-components">Using VanJS Components</a></h3><p><em>This is only supported in the converter library, not in the UI. The <a href="https://github.com/remarkablemark/html-react-parser/issues/168#issuecomment-699536994" class="w3-hover-opacity">root cause</a> is <a href="https://www.npmjs.com/package/html-dom-parser" class="w3-hover-opacity">html-dom-parser</a> doesn't support case-sensitive parsing on the client side.</em></p><p>The input HTML string can be a mix of HTML elements and custom UI components built with <strong>VanJS</strong>. To use custom UI components, just specify the component similar to regular HTML tags. For instance, assume we have custom UI components similar to the ones shown in <a href="https://vanjs.org/" class="w3-hover-opacity">https://vanjs.org/</a> home page:</p><pre><code class="language-js">const Hello = text =&gt; div(
7474
p("👋Hello"),
7575
ul(
7676
li(text),

converter-lib/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h1 class="w3-padding-16 w3-xxxlarge">
7070
components: [],
7171
}
7272
*/
73-
</code></pre><h3 class="w3-large w3-text-red" id="using-vanjs-components"><a class="self-link" href="#using-vanjs-components">Using VanJS Components</a></h3><p><em>This is only supported in the converter library, not in the UI.</em></p><p>The input HTML string can be a mix of HTML elements and custom UI components built with <strong>VanJS</strong>. To use custom UI components, just specify the component similar to regular HTML tags. For instance, assume we have custom UI components similar to the ones shown in <a href="https://vanjs.org/" class="w3-hover-opacity">https://vanjs.org/</a> home page:</p><pre><code class="language-js">const Hello = text =&gt; div(
73+
</code></pre><h3 class="w3-large w3-text-red" id="using-vanjs-components"><a class="self-link" href="#using-vanjs-components">Using VanJS Components</a></h3><p><em>This is only supported in the converter library, not in the UI. The <a href="https://github.com/remarkablemark/html-react-parser/issues/168#issuecomment-699536994" class="w3-hover-opacity">root cause</a> is <a href="https://www.npmjs.com/package/html-dom-parser" class="w3-hover-opacity">html-dom-parser</a> doesn't support case-sensitive parsing on the client side.</em></p><p>The input HTML string can be a mix of HTML elements and custom UI components built with <strong>VanJS</strong>. To use custom UI components, just specify the component similar to regular HTML tags. For instance, assume we have custom UI components similar to the ones shown in <a href="https://vanjs.org/" class="w3-hover-opacity">https://vanjs.org/</a> home page:</p><pre><code class="language-js">const Hello = text =&gt; div(
7474
p("👋Hello"),
7575
ul(
7676
li(text),

sitegen/convert-lib.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ export default (doc: HTMLDocument) => {
7878
),
7979
p(
8080
em(
81-
"This is only supported in the converter library, not in the UI.",
81+
"This is only supported in the converter library, not in the UI. The ",
82+
Link(
83+
"root cause",
84+
"https://github.com/remarkablemark/html-react-parser/issues/168#issuecomment-699536994",
85+
),
86+
" is ",
87+
Link(
88+
"html-dom-parser",
89+
"https://www.npmjs.com/package/html-dom-parser",
90+
),
91+
" doesn't support case-sensitive parsing on the client side.",
8292
),
8393
),
8494
p(

0 commit comments

Comments
 (0)