mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[xml] HtmlUtil#getStartTag: support tags with digits, like <h2>
GitOrigin-RevId: c3997423c38ade8a759aa086bc7d788c18e834b8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7f7cfc7d4c
commit
116aeed551
@@ -0,0 +1,14 @@
|
||||
// "Insert <p>" "false"
|
||||
class Test {
|
||||
/**
|
||||
* Answer to the ultimate question of life, the universe, and everything
|
||||
*<caret>
|
||||
* <h2>Subheader</h2>
|
||||
* That's it. That's all there is.
|
||||
*
|
||||
* @return The number 42
|
||||
*/
|
||||
int answer() {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
@@ -540,10 +540,11 @@ public final class HtmlUtil {
|
||||
if (startsWithTag(line)) {
|
||||
int tagStart = line.indexOf("<");
|
||||
if (tagStart >= 0) {
|
||||
tagStart ++;
|
||||
tagStart++;
|
||||
for (int i = tagStart; i < line.length(); i ++) {
|
||||
if (!Character.isAlphabetic(line.charAt(i))) {
|
||||
return line.substring(tagStart,i);
|
||||
char ch = line.charAt(i);
|
||||
if (!Character.isAlphabetic(ch) && !Character.isDigit(ch)) {
|
||||
return line.substring(tagStart, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user