Linting Fixes

This commit is contained in:
Leon Letto 2023-09-24 14:44:41 -07:00
parent 16aa76d350
commit 28c9808c1c
3 changed files with 10 additions and 8 deletions

View file

@ -8,6 +8,6 @@ const turnDownService = new TurnDownService();
* @param html - The HTML string to convert.
* @returns The converted Markdown string.
*/
export const convertHtmlToMarkdown = (html: string): string => {
export function convertHtmlToMarkdown(html: string): string {
return turnDownService.turndown(html);
};
}

View file

@ -1,13 +1,14 @@
<script setup lang="ts">
import { ref } from 'vue';
import { convertHtmlToMarkdown } from './html-md-converter-service'; // Import the service function
const htmlInput = ref(''); // Reference for HTML input
const markdownOutput = ref(''); // Reference for Markdown output
const convertHtmlToMd = () => {
function convertHtmlToMd() {
markdownOutput.value = convertHtmlToMarkdown(htmlInput.value); // Using the service function here
};
}
</script>
<template>
@ -16,7 +17,9 @@ const convertHtmlToMd = () => {
<c-input-text v-model:value="htmlInput" multiline placeholder="Paste your HTML here..." rows="5" />
<!-- Convert button -->
<button @click="convertHtmlToMd">Convert</button>
<button @click="convertHtmlToMd">
Convert
</button>
<!-- Display area for converted Markdown -->
<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. -->
</c-card>
</template>