English subtitles

← Fix It for Good Solution - Software Debugging

Get Embed Code
2 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Here again, we do have our remove html markup function
  2. with the parentheses already in.
  3. Here is the input that doesn't work properly.
  4. Note the usage of a backslash in order to escape the single quote,
  5. which otherwise would be seen as a
  6. delimiter around that string.
  7. We can print this out to see whether it contains the right value,
  8. and you see it has the don't in here exactly as in our example.
  9. In order to address this issue,
  10. we need to record which quote character we actually had
  11. and which we need to check for again.
  12. For this we need to change these lines in here.
  13. What we're going to is, we are going to use the quote variable
  14. to store the quote character, you see?
  15. Now quote is either false
  16. or it contains a double quote or a single quote,
  17. and this makes it impressibly true.
  18. Now this does only work when the quote variable is false,
  19. and this is how we start a quoted string.
  20. When we see that very quote again,
  21. we set quote to false,
  22. and this is what should now finally fix
  23. the problem in this html input.
  24. Then we press run.
  25. And now the single quote and the double quote is properly handled,
  26. and what we get is just the text without the html markup.