Commit Graph

4 Commits

Author SHA1 Message Date
Pranav K a41b9dc983 Add Html.Partial - sync versions of Html.PartialAsync
Fixes #1107
2014-10-14 15:15:50 -07:00
dougbu 56d66c090e Make HTML helper `null` handling consistent
- #874 lines 3, 4, and 6
- correct `Value()` to treat a `null` expression name the same as `string.Empty`
- add missing `[NotNull]` attributes in `EditorExtensions` and for `GenerateIdFromName()`
- consistently pass `null` for default expression names to the helpers
 - for example, from extension methods
- add test cases using `null` for expression name

nits:
- correct summary XML comment for `HtmlHelper` class
- use named parameters and prefer interface (not extension) methods in changed calls
- use `string.Empty` instead of `""` in a few tests
2014-08-06 16:04:56 -07:00
dougbu 8ab11bc073 Correct XML comment syntax
- fix problems at least with Roslyn compiler and VS IntelliSense or the Object Browser
 - `<see langref="keyword"/>` generates nothing
 - `<example>` at top level (outside `<summary>`) generates nothing
 - curly braces don't become angle brackets outside `<see cref="reference"/>` references
  - yeah, a point @yishaigalatzer asked about in a previous PR
- `<see href="reference"/>` is not valid
- correct some invalid use of angle brackets and remove useless empty elements
- correct unresolved XML comment references; generally, add namespace prefix

Symptoms for some of the above issues included
- generated XML comments such as `<!-- Badly formed XML comment ... -->`, usually indicating an unclosed element
- generated XML attributes such as `cref="!:..."`, indicating a broken reference
 - in a couple of cases we had `<typeparamref cref="TOption"/>`; attribute should be `"name"`

Few wording changes beyond
- `"opening </form> tag"` -> `"<form> start tag"`
- `"closing </form> tag"` -> `"</form> end tag"`

Also correct two typos in `HtmlHelper`

Will create a unit test to ensure XML syntax doesn't degrade going forward.  Separate PR.
- for now, check using `dir -r *.xml | sls '!'`
2014-08-05 14:24:48 -07:00
dougbu d0d7c6aef8 Add `HtmlHelperDisplayTextTest` and `HtmlHelperValueExtensionsTest` classes 2014-08-01 21:06:28 -07:00