solve issue/192 (the case when <br> tag exists within <pre> tag) #552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In no.750 and no.751, the author have written sample case using
<br>
tag within<pre>
tag, which is not a user concern but we might not have expected such cases.For example, no.750 サンプル1 入力1
<pre>6<br />1 1<br />7 4<br />0 5<br />1 3<br />-8 9<br />5 1</pre>
is given for online-judge-tools.
Beautiful Soup documents says that
So we should fix
s = tag.string or '' # tag.string for the tag "<pre></pre>" returns None
(in
_parse_sample_tag
function, onlinejudge/service/yukicoder.py file).In this pull request, I use
.strings
generator and iterate to make what the user expects.But the unexpected behavior for the user will remain in some problems. (although I have never seen them in a real environment.)
Let me show a tricky problem.
問題文
文字列Sが1行で与えられる. Sは小文字のアルファベットと
<
と>
と/
を用いて構成される.Sに含まれる
r
の個数を1行で出力しなさい.制約
1 <= S <= 100
サンプル
入力1
yukicode
r
出力1
4
... because this problem's author thinks 入力1 as
<strong>yuki</strong>code<br>r
In my opinion, user's expectation for
oj d
is to download what they see and we have not to handle with such tricky problems.