Comment 1 for bug 1906226

Revision history for this message
Leonard Richardson (leonardr) wrote :

Let's imagine you have markup like this:

<div>
Some text.
<script>
Some more text.
</script>
</div>

Generally speaking, users expect div.get_text() to say "Some text.", not "Some text. Some more text." People don't consider the contents of <script> tags to be "text". That's the original point of issue #1868861.

However, when you call get_text() *on a <script> tag*, it's reasonable to assume that you _do_ consider the contents of a <script> tag to be "text"--otherwise you wouldn't bother calling the method. The way I implemented #1868861 excludes "Some more text." even when you call script.get_text(). That's the underlying cause of this issue.

Revision 600 puts a system into place that changes the behavior of tags like <script>, <style>, and <template> to something more like what you are looking for.