Update index.html
Browse files- index.html +57 -18
index.html
CHANGED
|
@@ -1,19 +1,58 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="es">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Conversor de Formato</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
margin: 20px;
|
| 11 |
+
}
|
| 12 |
+
textarea, button {
|
| 13 |
+
width: 100%;
|
| 14 |
+
margin: 10px 0;
|
| 15 |
+
padding: 10px;
|
| 16 |
+
font-size: 16px;
|
| 17 |
+
}
|
| 18 |
+
.output {
|
| 19 |
+
margin-top: 20px;
|
| 20 |
+
padding: 10px;
|
| 21 |
+
background-color: #f9f9f9;
|
| 22 |
+
border: 1px solid #ddd;
|
| 23 |
+
white-space: pre-wrap;
|
| 24 |
+
}
|
| 25 |
+
</style>
|
| 26 |
+
</head>
|
| 27 |
+
<body>
|
| 28 |
+
|
| 29 |
+
<h1>Conversor de Formato de Texto</h1>
|
| 30 |
+
<textarea id="inputText" rows="10" placeholder="Introduce tu texto aquí"></textarea>
|
| 31 |
+
<button onclick="convertText()">Convertir Formato</button>
|
| 32 |
+
|
| 33 |
+
<div class="output" id="outputText"></div>
|
| 34 |
+
|
| 35 |
+
<script>
|
| 36 |
+
function convertText() {
|
| 37 |
+
const input = document.getElementById("inputText").value;
|
| 38 |
+
|
| 39 |
+
// Paso 1: Eliminar duplicados exactos
|
| 40 |
+
let cleanedInput = input.replace(/χ\s*2\s*=\s*\d+,\d+/g, '') // Elimina duplicados de χ² con números
|
| 41 |
+
.replace(/𝑔𝑙\s*=\s*\d+/g, '') // Elimina duplicados de gl=número
|
| 42 |
+
.replace(/p\s*<\s*0,\d+/g, '') // Elimina duplicados de p < valor
|
| 43 |
+
.replace(/\(\s*\)/g, '') // Elimina paréntesis vacíos
|
| 44 |
+
.replace(/\s+/g, ' ') // Reemplaza múltiples espacios por uno solo
|
| 45 |
+
.trim();
|
| 46 |
+
|
| 47 |
+
// Paso 2: Reemplazar el formato antiguo por el nuevo
|
| 48 |
+
const formattedText = cleanedInput
|
| 49 |
+
.replace(/𝜒\s*2/g, 'χ²') // Sustituye "𝜒 2" o "𝜒2" por "χ²"
|
| 50 |
+
.replace(/𝑔𝑙\s*=/g, 'gl =') // Sustituye "𝑔𝑙 =" por "gl ="
|
| 51 |
+
.replace(/𝑝\s*</g, 'p <'); // Sustituye "𝑝 <" por "p <'
|
| 52 |
+
|
| 53 |
+
document.getElementById("outputText").innerText = formattedText;
|
| 54 |
+
}
|
| 55 |
+
</script>
|
| 56 |
+
|
| 57 |
+
</body>
|
| 58 |
</html>
|