Generally accept whitespace around numbers in XML

Open
#25,171 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

Start by locating the XML reader's readInt and readDouble methods and read the linked pull request discussion for context. Check how each method handles numeric XML values surrounded by whitespace, then verify that both methods accept this input efficiently. Done means general whitespace handling works consistently for integer and double values.

Written by the indexing model from the issue text.

Description

tech debt

According to the XML schema specification, there may be whitespace around numbers, and this whitespace should be ignored (see https://github.com/musescore/MuseScore/pull/24967#issuecomment-2381444766).

The readInt and readDouble methods of our XML reader fails to parse numbers with whitespace around them. In https://github.com/musescore/MuseScore/pull/24967, this was fixed in a few cases where it was immediately necessary, but there is no reason to assume that we won't ever encounter whitespace elsewhere too. Furthermore, the implemented solution is potentially not optimal in terms of performance, because of string conversions, although the encountered strings are admittedly always going to be relatively short.

Task: implement a general and efficient solution for reading numbers surrounded by whitespace in the readInt and readDouble methods.

Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from musescore/MuseScore

All issues in musescore/MuseScore

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.