Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Misleading error message for improper MATLAB code sections

Aperta
#13 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
matlab
Ambito
documentation

Direzione di ricerca

Inizia riproducendo la sezione di codice MATLAB malformata con docerrun, quindi esamina i punti di ingresso segnalati docerrun>runDiv (riga 159), docerrun>run (riga 109) e docerrun (riga 44). Determina se MATLAB:m_illegal_character può essere identificato in modo affidabile e se il messaggio risultante debba distinguere una sezione di codice chiusa in modo errato. L’attività è completata quando sono disponibili una modifica concordata alla gestione degli errori e la copertura per questo input.

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

Descrizione

If you don't close a MATLAB code section properly, e.g. this: bug.md, where I have copy-pasted the matlab flag at the end of the section, you get this message when executing docerrun.

Warning: Error: Invalid text character. Check for unsupported symbol, invisible
character, or pasting of non-ASCII characters. 
> In docerrun>runDiv (line 159)
In docerrun>run (line 109)
In docerrun (line 44) 
```If you don't close a MATLAB code section properly, e.g. this: [bug.md](https://github.com/-/project/14868/uploads/36f0ed842b4138a86fb03ac4f38cc795/bug.md), where I have copy-pasted the matlab flag at the end of the section, you get this message when executing docerrun.

Warning: Error: Invalid text character. Check for unsupported symbol, invisible
character, or pasting of non-ASCII characters. 
> In docerrun>runDiv (line 159)
In docerrun>run (line 109)
In docerrun (line 44)

This lead me hunting for non-ASCII characters, until I eventually spotted the syntax error.

MATLAB treats the bad close as part of the expression to be evaluated. That is what leads to the error message.

>> ```matlab
 ```matlab
 ↑
Error: Invalid text character. Check for unsupported symbol, invisible character, or
pasting of non-ASCII characters.

GitHub automatically closes the unclosed Markdown to yield valid HTML. That is beyond my control. I don't want to get into client-side parsing of Markdown to double check.

Given the resulting HTML, the error message is reasonable, if not particularly clear.

The best I could do would be to augment MATLAB errors with identifier MATLAB:m_illegal_character in docerrun. This supposes that a common type of error is to incorrectly close a code block; I'm not sure that it is.

There's a related discussion at: https://talk.commonmark.org/t/insist-that-code-fenced-blocks-are-properly-closed/232/2

Lingua principale
MATLAB
Stelle
10
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mathworks/docmaker

Tutte le issue di mathworks/docmaker

Issue simili

Altre issue su MATLAB

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.