Download index.html from tx3bas/formato: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/spaces/tx3bas/formato/resolve/main/index.html
- Command line
-
hf download hf://spaces/tx3bas/formato/index.html
-
curl -L -o index.html https://huggingface.co/spaces/tx3bas/formato/resolve/main/index.html
2.33 kB
| <html lang="es"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Conversor de Formato</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| margin: 20px; | |
| } | |
| textarea, button { | |
| width: 100%; | |
| margin: 10px 0; | |
| padding: 10px; | |
| font-size: 16px; | |
| } | |
| .output { | |
| margin-top: 20px; | |
| padding: 10px; | |
| background-color: #f9f9f9; | |
| border: 1px solid #ddd; | |
| white-space: pre-wrap; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Conversor de Formato de Texto</h1> | |
| <textarea id="inputText" rows="10" placeholder="Introduce tu texto aquí"></textarea> | |
| <button onclick="convertText()">Convertir Formato</button> | |
| <div class="output" id="outputText"></div> | |
| <script> | |
| function convertText() { | |
| const input = document.getElementById("inputText").value; | |
| // Paso 1: Limpieza inicial para eliminar duplicaciones | |
| let cleanedInput = input | |
| .replace(/χ\s*2\s*=\s*\d+,\d+/g, '') // Elimina duplicados de χ² con números | |
| .replace(/gl\s*=\s*\d+/g, '') // Elimina duplicados de gl=número | |
| .replace(/p\s*<\s*0,\d+/g, '') // Elimina duplicados de p < valor | |
| .replace(/ϕ\s*=\s*−?\d+,\d+/g, '') // Elimina duplicados de ϕ=valor | |
| .replace(/V\s*=\s*\d+,\d+/g, '') // Elimina duplicados de V=valor | |
| .replace(/α\s*=\s*0,\d+/g, '') // Elimina duplicados de α=valor | |
| .replace(/\(\s*\)/g, '') // Elimina paréntesis vacíos | |
| .replace(/\s+/g, ' ') // Reemplaza múltiples espacios por uno solo | |
| .trim(); | |
| // Paso 2: Reemplazo final con el formato correcto | |
| const formattedText = cleanedInput | |
| .replace(/𝜒\s*2/g, 'χ²') // Reemplaza "𝜒 2" o "𝜒2" por "χ²" | |
| .replace(/𝑔𝑙\s*=/g, 'gl =') // Reemplaza "𝑔𝑙 =" por "gl =" | |
| .replace(/𝑝\s*</g, 'p <') // Reemplaza "𝑝 <" por "p <" | |
| .replace(/𝜙\s*=/g, 'ϕ =') // Reemplaza "𝜙 =" por "ϕ =" | |
| .replace(/𝑉\s*=/g, 'V =') // Reemplaza "𝑉 =" por "V =" | |
| .replace(/𝛼\s*=/g, 'α ='); // Reemplaza "𝛼 =" por "α =" | |
| document.getElementById("outputText").innerText = formattedText; | |
| } | |
| </script> | |
| </body> | |
| </html> | |