mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-08 15:15:02 -04:00
Linting Fixes
This commit is contained in:
parent
16aa76d350
commit
28c9808c1c
3 changed files with 10 additions and 8 deletions
|
@ -8,6 +8,6 @@ const turnDownService = new TurnDownService();
|
||||||
* @param html - The HTML string to convert.
|
* @param html - The HTML string to convert.
|
||||||
* @returns The converted Markdown string.
|
* @returns The converted Markdown string.
|
||||||
*/
|
*/
|
||||||
export const convertHtmlToMarkdown = (html: string): string => {
|
export function convertHtmlToMarkdown(html: string): string {
|
||||||
return turnDownService.turndown(html);
|
return turnDownService.turndown(html);
|
||||||
};
|
}
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { convertHtmlToMarkdown } from './html-md-converter-service'; // Import the service function
|
import { convertHtmlToMarkdown } from './html-md-converter-service'; // Import the service function
|
||||||
|
|
||||||
const htmlInput = ref(''); // Reference for HTML input
|
const htmlInput = ref(''); // Reference for HTML input
|
||||||
const markdownOutput = ref(''); // Reference for Markdown output
|
const markdownOutput = ref(''); // Reference for Markdown output
|
||||||
|
|
||||||
const convertHtmlToMd = () => {
|
function convertHtmlToMd() {
|
||||||
markdownOutput.value = convertHtmlToMarkdown(htmlInput.value); // Using the service function here
|
markdownOutput.value = convertHtmlToMarkdown(htmlInput.value); // Using the service function here
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -16,7 +17,9 @@ const convertHtmlToMd = () => {
|
||||||
<c-input-text v-model:value="htmlInput" multiline placeholder="Paste your HTML here..." rows="5" />
|
<c-input-text v-model:value="htmlInput" multiline placeholder="Paste your HTML here..." rows="5" />
|
||||||
|
|
||||||
<!-- Convert button -->
|
<!-- Convert button -->
|
||||||
<button @click="convertHtmlToMd">Convert</button>
|
<button @click="convertHtmlToMd">
|
||||||
|
Convert
|
||||||
|
</button>
|
||||||
|
|
||||||
<!-- Display area for converted Markdown -->
|
<!-- Display area for converted Markdown -->
|
||||||
<c-input-text v-model:value="markdownOutput" multiline placeholder="Converted Markdown will appear here..." rows="5" />
|
<c-input-text v-model:value="markdownOutput" multiline placeholder="Converted Markdown will appear here..." rows="5" />
|
||||||
|
@ -24,4 +27,3 @@ const convertHtmlToMd = () => {
|
||||||
<!-- Optionally, you can add more features like 'Clear', 'Copy to Clipboard', etc. -->
|
<!-- Optionally, you can add more features like 'Clear', 'Copy to Clipboard', etc. -->
|
||||||
</c-card>
|
</c-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue