| <!DOCTYPE html> |
| <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; |
| |
| |
| let cleanedInput = input |
| .replace(/χ\s*2\s*=\s*\d+,\d+/g, '') |
| .replace(/gl\s*=\s*\d+/g, '') |
| .replace(/p\s*<\s*0,\d+/g, '') |
| .replace(/ϕ\s*=\s*−?\d+,\d+/g, '') |
| .replace(/V\s*=\s*\d+,\d+/g, '') |
| .replace(/α\s*=\s*0,\d+/g, '') |
| .replace(/\(\s*\)/g, '') |
| .replace(/\s+/g, ' ') |
| .trim(); |
| |
| |
| const formattedText = cleanedInput |
| .replace(/𝜒\s*2/g, 'χ²') |
| .replace(/𝑔𝑙\s*=/g, 'gl =') |
| .replace(/𝑝\s*</g, 'p <') |
| .replace(/𝜙\s*=/g, 'ϕ =') |
| .replace(/𝑉\s*=/g, 'V =') |
| .replace(/𝛼\s*=/g, 'α ='); |
| |
| document.getElementById("outputText").innerText = formattedText; |
| } |
| </script> |
|
|
| </body> |
| </html> |
|
|