typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.54k stars 56 forks source link

HTML tag auto-complete error #5004

Open collingsr opened 2 years ago

collingsr commented 2 years ago

When in rich text mode if I am typing html code for a link the program attempts to auto-complete the closing tag but instead gives incorrect text. Error can be 'fixed' by typing in source code mode instead.

To Reproduce

  1. Open existing MD file in rich text mode. Contents of file is only markdown+html, no other code.
  2. Type in [ a href="link" ]
  3. Add link text.
  4. Press the left caret key to type the closing tag [ /a ]
  5. Suddenly these half-formed "/a"s appear, as seen in screenshot. And if I try to delete the "/a" and type any other letter I get more "/a"s with every button press.

Workaround: go into source code mode and type the closing tag in correctly. There is no auto-complete in source code mode, as expected.

Expected behavior For the tag to not auto-complete at all, because I have unchecked both auto-complete settings in preferences. Failing that, to auto-complete correctly (which it does most of the time).

Screenshots / Screencasts

bad:

Screen Shot 2022-01-15 at 3 50 06 AM

good:

Screen Shot 2022-01-15 at 3 50 57 AM

Desktop (please complete the following information):

Typora Version Typora 1.0.5

Additional context

I deleted all the original text out of the file I was going to attach in order to protect personal information and the bug persisted, but when I changed the title of the file the bug disappeared (silly move on my part). The original title was something like "this is a ? test.md". Changed the title back to that exact string and the bug did not reappear. So now I don't have a sample file to share, unfortunately, unless someone can think of some way to try to reproduce the bug reliably.

Can't say for sure when it started happening, but definitely before v.1.0

abnerlee commented 2 years ago

relates #2608 #3197

abnerlee commented 2 years ago

Still need a way to reproduce it..

collingsr commented 2 years ago

Sorry for the duplicate issue, I could swear those didn't come up when I searched... If/when it happens again I'll be sure to save a sample file properly and report back. Would saving a debugging log help as well?

collingsr commented 2 years ago

Happened again! This time saved the sample file and some of the debug log from the console which is hopefully helpful.

sample file.md 2022-02-08 typora bug report.txt