tx3bas commited on
Commit
4abeb4e
·
verified ·
1 Parent(s): 176866a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +57 -18
index.html CHANGED
@@ -1,19 +1,58 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>