Skip to content

Commit

Permalink
Merge pull request #253 from Qrlew/251-dot-should-not-fail-when-chara…
Browse files Browse the repository at this point in the history
…cters-are-not-properly-escaped-eg-or

251 dot should not fail when characters are not properly escaped eg or
  • Loading branch information
ngrislain authored Jan 17, 2024
2 parents 6d31978 + 19c4e5b commit 8e278c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ 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).

## [Unreleased]
### Changed
- Fixed [#251](https://github.com/Qrlew/qrlew/issues/251) and [#252](https://github.com/Qrlew/qrlew/issues/252)

## [0.9.4] - 2024-01-17
### Changed
Expand Down
12 changes: 7 additions & 5 deletions src/relation/dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ impl fmt::Display for FieldDataTypes {
shorten_string(&if let Some(c) = field.constraint() {
format!(
"{} = {} ∈ {} {}",
field.name(),
dot::escape_html(&field.name().to_string()),
dot::escape_html(&expr.to_string()),
field.data_type(),
dot::escape_html(&field.data_type().to_string()),
c
)
} else {
format!(
"{} = {} ∈ {}",
field.name(),
dot::escape_html(&field.name().to_string()),
dot::escape_html(&expr.to_string()),
field.data_type()
dot::escape_html(&field.data_type().to_string()),
)
})
);
Expand Down Expand Up @@ -404,7 +404,9 @@ mod tests {
#[test]
fn test_escape_html() {
namer::reset();
let schema: Schema = vec![("a", DataType::float())].into_iter().collect();
let schema: Schema = vec![
("a", DataType::float()),
("b", DataType::text_values(&["A&B".into(), "C>D".into()]))].into_iter().collect();
let table: Relation = Relation::table()
.name("table")
.schema(schema.clone())
Expand Down

0 comments on commit 8e278c1

Please sign in to comment.