So today I made some progress! One of the major things I did today was using GitHub Pages to create a basic website for LibriFox. A Jekyll installation will come later this week when I go on vacation. From what I've learned, Jekyll is great, and works amazingly with blogging. I was thinking of somehow linking our Blogger posts to the website sometime later on. Anyways, with some DNS changes, I was able to route the site to the GitHub pages branch, which actually is in the LibriFox project but on a different branch [can be changed later if needed]. The best thing is, it's completely free, and we can modify the code of the website whenever we want. I plan to change it to a custom website, instead of its current template, sometime later on. The main reason I got the website done today was because I didn't want to jump ahead with unit testing without discussing everything first tomorrow, and also due to the fact that librifox.com was available and I just had to go for it :)
But for now, we need to focus on unit testing. I actually just did some minor testing today, and I've already found a few issues! One of the main ones was with our stripHTMLTags method. It's very, very specific, but who knows, it might pop up in a few of the books' descriptions, causing some issues.
Basically, the name of stripHTMLTags is what we use it for. LibriVox's API and RSS feeds provide descriptions of each book. In our search results, I have previously coded it such that short bits of the description are displayed below each book. This is fine, until you notice that all descriptions have HTML tags in them - bold, italics, links, etc. and this ruins JQueryMobile's list. As such, we need a way to remove the HTML tags so that the list displays nicely, and for the most part, this method performs that well. However, under very specific circumstances, the method will result in large blocks of text being accidentally excluded from the description.
Imagine you had text like this for your description:
"<b>The left angle bracket, also known as <, is often used as a less than sign. On the other hand, the right angle bracket, known as >, is often used as a greater than sign.</b>"
You'd expect something like:
"The left angle bracket, also known as <, is often used as a less than sign. On the other hand, the right angle bracket, known as >, is often used as a greater than sign."
to be your output. However, our method is outputting:
"The left angle bracket, also known as , is often used as a greater than sign."
And this can easily be seen why, we're using this code for our stripHTMLTags method:
It's quick, easy, and for the most part does well. However, if any of these characters are used in a way similar to that shown above, it could cause issues for displaying descriptions.
Anyways, that's it for today; I hope to find more bugs tomorrow!
I just grabbed librifox.net, so we're covered ;-)
ReplyDeleteGreat post! The example you provide is clear and easy to follow, and illustrates your point well. Dealing with markup, HTML and other, will be something you will encounter frequently, so it is no surprise that we have to deal with it here.
hello
ReplyDeleteCan’t forget about the extra security that a static site provides. I also am stoked about INK for All's ability to export articles as a Markdown format. Historically, I had went with wp, just made the decision that a static site is the best option for my company’s blog. Always thought that WordPress was a little much: http://bit.ly/2ECXoDa