CzompiSoftware / CzompiSoftware/Markdig.Extensions.Xmdl.Lua

Lua Code Parser Fails with Empty Lines in Code

Aperta
#4 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
C#
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The current Lua code parser has an issue where it fails to parse or execute scripts that contain empty lines. This limitation restricts developers from writing clean and readable Lua code within XMDL files, as empty lines are commonly used for improving code clarity and separation of logic.

**Steps to Reproduce:**
1. Write an XMDL file with a Lua script containing empty lines.
```xmdl
@lua{>
local a = 10

local b = 20
local sum = a + b

document.insertMarkdown("Sum: " .. sum)
<}
```
2. Render the XMDL file in CwATE.
3. Observe that the Lua code fails to execute.

**Expected Behavior:**
The Lua code parser should handle empty lines gracefully and execute the script without errors.

**Actual Behavior:**
The Lua code parser fails to execute the script if there are empty lines, leading to unexpected behavior or errors.

**Proposed Solution:**
- Update the Lua code parser to properly ignore or skip over empty lines while parsing the script.
- Add test cases to ensure the parser handles scripts with empty lines correctly.

**Impact:**
This issue affects the readability and maintainability of Lua scripts in XMDL files, as developers are forced to write compact code without empty lines.

**Additional Notes:**
Addressing this issue will improve developer experience and allow for better scripting practices within the CwATE platform.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia individuando il punto di ingresso del parser Lua nell’estensione CwATE XMDL e riproduci il problema con l’esempio di riga vuota riportato nella segnalazione. Aggiungi un test di regressione per uno script Lua contenente righe vuote e verifica che il rendering lo esegua correttamente e senza errori.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp, lua
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.