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. * @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);
}; }

View file

@ -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>

View file

@ -1,4 +1,4 @@
import {BrandHtml5} from '@vicons/tabler'; import { BrandHtml5 } from '@vicons/tabler';
import { defineTool } from '../tool'; import { defineTool } from '../tool';
export const tool = defineTool({ export const tool = defineTool({
@ -8,4 +8,4 @@ export const tool = defineTool({
keywords: ['html', 'md', 'converter'], keywords: ['html', 'md', 'converter'],
component: () => import('./html-md-converter.vue'), component: () => import('./html-md-converter.vue'),
icon: BrandHtml5, icon: BrandHtml5,
}); });