mirror of https://github.com/Textualize/rich.git
fixed scientific notation numbers
This commit is contained in:
parent
1501671a4d
commit
c2716b2b14
|
@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [5.0.1] - Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed deprecation warnings re backslash https://github.com/willmcgugan/rich/issues/210
|
||||
- Fixed repr highlighting of scientific notation, e.g. 1e100
|
||||
|
||||
## [5.0.0] - 2020-08-02
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -75,7 +75,7 @@ class ReprHighlighter(RegexHighlighter):
|
|||
r"(?P<tag_start>\<)(?P<tag_name>\w*)(?P<tag_contents>.*?)(?P<tag_end>\>)",
|
||||
r"(?P<attrib_name>\w+?)=(?P<attrib_value>\"?[\w_]+\"?)",
|
||||
r"(?P<bool_true>True)|(?P<bool_false>False)|(?P<none>None)",
|
||||
r"(?P<number>(?<!\w)\-?[0-9]+\.?[0-9]*\b)",
|
||||
r"(?P<number>(?<!\w)\-?[0-9]+\.?[0-9]*(e[\-\+]?\d+?)?\b)",
|
||||
r"(?P<number>0x[0-9a-f]*)",
|
||||
r"(?P<path>\B(\/[\w\.\-\_\+]+)*\/)(?P<filename>[\w\.\-\_\+]*)?",
|
||||
r"(?<!\\)(?P<str>b?\'\'\'.*?(?<!\\)\'\'\'|b?\'.*?(?<!\\)\'|b?\"\"\".*?(?<!\\)\"\"\"|b?\".*?(?<!\\)\")",
|
||||
|
@ -105,3 +105,7 @@ if __name__ == "__main__": # pragma: no cover
|
|||
console.print("foo /foo/bar/baz/egg.py word")
|
||||
console.print("foo /foo/bar/ba._++z/egg+.py word")
|
||||
console.print("https://example.org?foo=bar")
|
||||
|
||||
console.print(1234567.34)
|
||||
console.print(1 / 2)
|
||||
console.print(-1 / 123123123123)
|
||||
|
|
|
@ -16,7 +16,6 @@ from typing import (
|
|||
Deque,
|
||||
Dict,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
NamedTuple,
|
||||
NewType,
|
||||
|
|
Loading…
Reference in New Issue