Skip to content

Commit

Permalink
entirely remove oyko_link section
Browse files Browse the repository at this point in the history
Ugly, takes up a lot of space, and serves no practical use

Details: FooSoft/yomichan#1910
  • Loading branch information
Thermospore committed Sep 4, 2021
1 parent 865587a commit 43b77a3
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 114 deletions.
26 changes: 8 additions & 18 deletions koj72yomi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,25 +556,15 @@ int main()
}
else if (tagAttributes == "class=\\\"oyko_link\\\"")
{
// Encapsulate those long xref lists that use yajirusi2.svg
fnOpenReplace = "\", {\"tag\": \"div\", \"style\": {\"fontSize\": \"x-small\"}, \"content\": [\"";
fnCloseReplace = "\"]}, \"";
// List of words that are grouped in the same physical location in the paper copy
// Ugly, takes up a lot of space, and serves no practical use. Removing entirely
// Details: https://github.com/FooSoft/yomichan/issues/1910
fnDelete = true;

// Strip <br> tags (because look at shit like まくら 【枕】or even worse にほん 【日本】)
// ...while carefully adjusting closeTagStart position lol
while(1<2)
{
int brPos = html.find("<br>", openTagEnd);
if (brPos != -1 && brPos < closeTagStart)
{
html.replace(brPos, 4, " ");
closeTagStart -= 3;
}
else
{
break;
}
}
// fnDelete removes the tag itself but leaves the contents, so we need to remove that manually
// (while not forgetting to adjust our closeTagStart index...)
html.erase(openTagEnd + 1, tagContents.length());
closeTagStart = openTagEnd + 1;
}
}
else if (tagType == "a")
Expand Down
Loading

0 comments on commit 43b77a3

Please sign in to comment.