Bug in isOkTag()?
![]() ![]() |
Hi, good script. I noticed that text in p tags wasn't getting replaced, and discovered that the function isOkTag() will find p in the list of prohibited tags at index 0, since ",pre" starts with ",p". This can be fixed by changing the line: return (",pre,blockquote,code,input,button,textarea".indexOf(","+tag) == -1);to: return (",pre,blockquote,code,input,button,textarea,".indexOf(","+tag+",") == -1);which will only match whole tag names. Now Wikipedia and other sites that I've checked so far work as expected. |

