Skip to content

Commit

Permalink
[Issue #2943] markup split typo bugfix (#2942)
Browse files Browse the repository at this point in the history
* Fixes a bug in the markup split logic that could result in markup containing quotation marks to not be properly evaluated
* Updates seed data to include descriptions with links and markup
  • Loading branch information
doug-s-nava authored Nov 25, 2024
1 parent d97e5c1 commit 822fe2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions api/tests/src/db/models/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class CustomProvider(BaseProvider):
"{{agency_code}} is looking to further investigate this topic. {{paragraph}}",
"<p>{{paragraph}}</p><p><br></p><p>{{paragraph}}</p>",
"The purpose of this Notice of Funding Opportunity (NOFO) is to support research into {{job}} and how we might {{catch_phrase}}.",
"<div>{{paragraph:long}} <a href='{{relevant_url}}'>{{sentence}}</a> {{paragraph:long}}</div> <div>{{paragraph:long}} <a href='{{relevant_url}}'>{{sentence}}</a> {{paragraph:long}}</div>",
]

# In the formatting, ? becomes a random letter, # becomes a random digit
Expand Down Expand Up @@ -191,6 +192,7 @@ def opportunity_title(self) -> str:
return self.generator.parse(pattern)

def summary_description(self) -> str:
self.generator.set_arguments("long", {"nb_sentences": 25})
pattern = self.random_element(self.SUMMARY_DESCRIPTION_FORMATS)
return self.generator.parse(pattern)

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/utils/generalUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const splitMarkup = (
}
// handle things like urls within tag params that need to be ignored
if (
(tracker.openTagIndicator && character === `"`) ||
character === `'`
tracker.openTagIndicator &&
(character === `"` || character === `'`)
) {
tracker.inQuotes = !tracker.inQuotes;
}
Expand Down

0 comments on commit 822fe2e

Please sign in to comment.