This code removes HTML text nodes that have no non-whitespace content.
foreach (var node in document.DocumentNode
.DescendantsAndSelf()
.Where(n => n.NodeType == HtmlNodeType.Text &&
string.IsNullOrWhiteSpace(n.InnerText)).ToList())
{
node.Remove();
}
DescendantsAndSelf()
will include the root node in the search, which may be necessary depending on the requirements.ToList()
to create a separate list for removal, avoiding issues with modifying the collection while iterating
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
Customers can now deterministically restrict their workflows to run on a specific set of runners using the names of their runner groups in the runs-on
key of their workflow YAML. This prevents the unintended case where your job runs on a runner outside your intended group because the unintended runner shared the same labels as the runners in your intended runner group.
Example of the new syntax to ensure a runner is targeted from your intended runner group:
runs-on:
group: my-group
labels: [ self-hosted, label-1 ]
In addition to the workflow file syntax changes, there are also new validation checks for runner groups at the organization level. Organizations will no longer be able to create runner groups using a name that already exists at the enterprise level. A warning banner will display for any existing duplicate runner groups at the organization level. There's no restriction on the creation of runner groups at the enterprise level.
This feature change applies to enterprise plan customers as only enterprise plan customers are able to create runner groups.
Source: GitHub Actions: Restrict workflows to specific runners using runner group names
C# String.StartsWith() method determines whether this string instance starts with the specified character or string.
String.StartsWith(ch)
String.StartsWith(str)
String.StartsWith(str, ignoreCase, culture)
String.StartsWith(str, comparisonType)
The JSON-LD Playground is a web-based JSON-LD viewer and debugger. If you are interested in learning JSON-LD, this tool will be of great help to you. Developers may also use the tool to debug, visualize, and share their JSON-LD markup.
Introduction