diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c
index 17ef46cc73..dc99a42a95 100644
--- a/programs/cmm/browser/WebView.c
+++ b/programs/cmm/browser/WebView.c
@@ -29,14 +29,14 @@
char homepage[] = FROM "html\homepage.htm";
#ifdef LANG_RUS
- char version[]=" Текстовый браузер 1.0 Beta 4";
+ char version[]=" Текстовый браузер 1.0 Beta 5";
?define IMAGES_CACHE_CLEARED "Кэш картинок очищен"
?define T_LAST_SLIDE "Это последний слайд"
char loading[] = "Загрузка страницы...
";
char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n";
#else
- char version[]=" Text-based Browser 1.0 Beta 4";
+ char version[]=" Text-based Browser 1.0 Beta 5";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...
";
@@ -390,6 +390,7 @@ void Scan(int id)
return;
case 052: //F3
ShowSource();
+ WB1.Parse();
break;
case 053: //F4
if (strncmp(#URL,"http:",5)==0)
diff --git a/programs/cmm/browser/show_src.h b/programs/cmm/browser/show_src.h
index 8fde215e28..3b2faf720e 100644
--- a/programs/cmm/browser/show_src.h
+++ b/programs/cmm/browser/show_src.h
@@ -1,8 +1,10 @@
+enum { TAG, OPTION_VALUE, TEXT, COMMENT };
+
//you are butifull, you are butifull
dword ShowSource()
{
dword new_buf, new_buf_start, i;
- byte ww, param, comment;
+ byte ww, mode;
if (souce_mode) return;
souce_mode = true;
@@ -19,46 +21,51 @@ dword ShowSource()
{
strcat(new_buf, "<");
new_buf+=20;
+ mode = COMMENT;
}
else
{
strcat(new_buf, "<");
- new_buf+=20;
+ new_buf+=20;
+ mode = TAG;
}
break;
case '>':
- if (!param) //fix non-closed quote
+ if (mode == OPTION_VALUE) //fix non-closed quote in TAG
{
- param = 1;
strcat(new_buf, """);
new_buf+=12;
+ mode = TAG;
}
- if (ESBYTE[i-1]=='-') && (ESBYTE[i-2]=='-')
+ if (mode == COMMENT) && (ESBYTE[i-1]=='-') && (ESBYTE[i-2]=='-')
{
strcat(new_buf, ">");
new_buf+=10;
+ mode = TEXT;
}
- else
+ if (mode == TAG)
{
strcat(new_buf, ">");
- new_buf+=10;
+ new_buf+=10;
+ mode = TEXT;
}
break;
case '\"':
case '\'':
- if (param)
+ if (mode == TAG)
{
- param = 0;
strcat(new_buf, """);
new_buf+=22;
+ mode = OPTION_VALUE;
+ break;
}
- else
+ if (mode == OPTION_VALUE)
{
- param = 1;
strcat(new_buf, """);
new_buf+=12;
+ mode = TAG;
+ break;
}
- break;
default:
chrcat(new_buf, ww);
}