Commit graph

32 commits

Author SHA1 Message Date
Jim Derry dedcb7bb4d SPRTF is now compatible with macOS and Linux, and most likely all supported
platforms.
2017-10-03 22:31:55 -04:00
Jim Derry a1e4dcc066 Removed option for SUPPORT_ACCESSIBILITY_CHECKS, regen'd strings. 2017-10-03 12:45:34 -04:00
Jim Derry b0f584fa24 Address #575 by adding a new footnote in TY_(ErrorSummary) suggesting that if
this behavior is not wanted, then which option to use to prevent it.
2017-09-29 11:25:17 -04:00
Jim Derry f26d70c394 Added Doxygen documentation to the header. Some of these could be expanded a
bit, but they look nice in Doxygen.
2017-09-19 15:07:52 -04:00
Jim Derry 51e2e0f3bd Following the example of the recent changes in the "reports" aspect of Tidy's
output, classify and organize all of the dialogue type of messages. This paves
the way towards formalizing (and expanding!) the footnotes system with much
greater explanatory text, as well as providing much better fine-grained control
over which types of output that Tidy will produce.

Moved STRING_DOCTYPE_GIVEN, STRING_CONTENT_LOOKS, and STRING_NO_SYSID to the
Report paradigm from the Dialogue paradigm, as these are items that are
traditionally TidyInfo and included in the Report table, rather than any type
of dialogue.

At this point, we are exactly passing all tests.
2017-09-19 13:52:27 -04:00
Jim Derry d8220c061f Updated the remaining items, including all of the accessibility module items.
Note that there are several regressions in the accessibility test suit that
are not related to output messages. These are a result of previous work, and
these results should be updated in the test suite when this item is merged.
2017-09-04 17:35:57 -04:00
Jim Derry 832b4772ad A bit of organizational cleanup. 2017-09-04 16:49:49 -04:00
Jim Derry bc4388e317 Migrated surrogate errors; removed break after return. 2017-09-04 16:38:07 -04:00
Jim Derry 5b6edb5813 EncodingWarning and MissingAttr migrated. 2017-09-04 16:12:01 -04:00
Jim Derry f49c419908 Implement formatter for encoding reports. 2017-09-04 15:50:45 -04:00
Jim Derry 8cb4198724 Entity errors migrated. 2017-09-04 15:28:08 -04:00
Jim Derry 283f8974c3 Migrated reports using formatFileError and formatStandard to flexible messaging system. Migrated old reportNotice() to report(). 2017-09-04 11:24:48 -04:00
Jim Derry 0c8f684a4b Migrated messages using formatter formatBadArgument to new message system. All tests passing. 2017-09-02 18:00:46 -04:00
Jim Derry 46aa9605ee All reports that can use formatAttributeReport are now using it. Moved the
badAccess flag to the point of detection.
2017-09-02 17:29:56 -04:00
Jim Derry 00178113c8 A *complete* inventory of every message has been completed, and the dispatchTable
reflects such. Some fleshed in report formatters are included with cases for
several of Tidy's reports, but nothing is yet enabled. All reporting is status
quo, and this is just a bunch of dead code at this point.
2017-09-02 16:47:14 -04:00
Jim Derry e5eb09198d Begin migration towards "one output function to rule them all." Consolidated
the basic reporting functions that share the same signature. This also resulted
in eliminating a string, and adding a new string to disambiguate between
errors and warnings.
2017-08-30 20:01:44 -04:00
Jim Derry ce105dcf09 Address #391. Tested on macOS and Win10.
- Add a check upon opening a file for validity of the file.
- Add a new message to indicate that the path is not a file.
2017-05-07 17:04:53 -04:00
Jim Derry 13122e8862 Added tidyErrorCodeFromKey()
Added tidyGetMessageDoc()
Improved the Public API documentation.
2017-03-19 08:15:32 -04:00
Jim Derry 11178d775b Massive Revamp of the Messaging System
This is a rather large refactoring of Tidy's messaging system. This was done
mostly to allow non-C libraries that cannot adequately take advantage of
arg_lists a chance to query report filter information for information related
to arguments used in constructing an error message.

Three main goals were in mind for this project:

- Don't change the contents of Tidy's existing output sinks. This will ensure
  that changes do no affect console Tidy users, or LibTidy users who use the
  output sinks directly. This was accomplished 100% other than some improved
  cosmetics in the output. See tidy-html5-tests repository, the `refactor` and
  `more_messages_changes` branches for these minor diffs.
- Provide an API that is simple and also extensible without having to write new
  error filters all the time. This was accomplished by adding the new message
  callback `TidyMessageCallback` that provides callback functions an opaque
  object representing the message, and an API to query the message for wanted
  details. With this, we should never have to add a new callback routine again,
  as additional API can simply be written against the opaque object.
- The API should work the same as the rest of LibTidy's API in that it's
  consistent and only uses simple types with wide interoperability with other
  languages. Thanks to @gagern who suggested the model for the API in #409.
  Although the API uses the "Tidy" way off accessing data via an iterator
  rather than an index, this can be easily abstracted in the target language.

There are two *major* API breaking changes:

- Removed TidyReportFilter2
  - This was only used by one application in the entire world, and was a hacky
    kludge that served its purpose. TidyReportCallback (né TidyReportFilter3)
    is much better. If, for some reason, this affects you, I recommend using
    TidyReportCallback instead. It's a minor change for your application.
- Renamed TidyReportFilter3 to TidyReportCallback
  - This name is much more semantic, and much more sensible in light of
    improved callback system. As the name implies, it remains capable of
    *only* receiving callbacks for Tidy "reports."

Introducing TidyMessageCallback, and a new message interrogation API.

- As its name implies, it is able to capture (and optionally suppress) *all*
  of Tidy's output, including the dialogue messages that never make it to
  the existing report filters.
- Provides an opaque `TidyMessage` and an API that can be used to query against
  it to find the juicy goodness inside.
  - For example, `tidyGetMessageOutput( tmessage )` will return the complete,
    localized message.
  - Another example, `tidyGetMessageLine( tmessage )` will return the line the
    message applies to.
- You can also get information about the individual arguments that make up a
  message. By using the `tidyGetMessageArguments( tmessage )` itorator and
  `tidyGetNextMessageArgument` you will obtain an opaque `TidyMessageArgument`
  which has its own interrogation API. For example:
    - tidyGetArgType( tmessage, &iterator );
    - tidyGetArgFormat( tmessage, &iterator );
    - tidyGetArgValueString( tmessage, &iterator );
    - …and so on.

Other major changes include refactoring `messages.c` to use the new message
"object" directly when emitting messages to the console or output sinks. This
allowed replacement of a lot of specialized functions with generalized ones.

Some of this generalizing involved modifications to the `language_xx.h` header
files, and these are all positive improvements even without the above changes.
2017-03-13 13:28:57 -04:00
Jim Derry 165acc4f3e Several foundational changes preparing for release of 5.4 and future 5.5:
- Consolidated all output string definitions enums into `tidyenum.h`, which
    is where they belong, and where they have proper visibility.
  - Re-arranged `messages.c/h` with several comments useful to developers.
  - Properly added the key lookup functions and the language localization
    functions into tidy.h/tidylib.c with proper name-spacing.
  - Previous point restored a *lot* of sanity to the #include pollution that's
    been introduced in light of these.
  - Note that opaque types have been (properly) introduced. Look at the updated
    headers for `language.h`. In particular only an opaque structure is passed
    outside of LibTidy, and so use TidyLangWindowsName and TidyLangPosixName
    to poll these objects.
  - Console application updated as a result of this.
  - Removed dead code:
    - void TY_(UnknownOption)( TidyDocImpl* doc, char c );
    - void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file );
  - Redundant strings were removed with the removal of this dead code.
  - Several enums were given fixed starting values. YOUR PROGRAMS SHOULD NEVER
    depend on enum values. `TidyReportLevel` is an example of such.
  - Some enums were removed as a result of this. `TidyReportLevel` now has
    matching strings, so the redundant `TidyReportLevelStrings` was removed.
  - All of the PO's and language header files were regenerated as a result of
    the string cleanup and header cleanup.
  - Made the interface to the library version and release date consistent.
  - CMakeLists.txt now supports SUPPORT_CONSOLE_APP. The intention is to
    be able to remove console-only code from LibTidy (for LibTidy users).
  - Updated README/MESSAGES.md, which is *vastly* more simple now.
2017-02-17 15:29:26 -05:00
Geoff McLane 7f73d4f429 Issue #483 - Add ReportSurrogateError() service and connect. 2017-02-11 18:33:45 +01:00
Geoff McLane 75bc1f06c7 More updates for Issue #483 - Start warning msgs - WIP 2017-02-09 20:55:23 +01:00
Jim Derry 2ade3357a9 Phase 2
This is a MUCH SANER approach to what I was trying to do (now that I screwed up enough internals to understand some of them!
At this point there are zero exit state reversions, and zero markup reversions! There are still 21 errout reversions; I'll
annotate and adjust as necessary.
2016-02-13 11:31:16 +08:00
Jim Derry 9ae15f45a7 Consistent tabs
Fixed tabs in template file, and regen'd all related files.
2016-01-30 15:51:54 +08:00
Jim Derry bf70824cc2 - Add TidyReportFilter3, which removes translation strings completely from the equation. It would be a good idea to deprecate TidyReportFilter2, which is vulnerable to changing strings in Tidy source.
- Documentation reminders for future enum changes.
- Documentation updates.
2016-01-30 15:51:53 +08:00
Jim Derry d505869910 Localization Support added to HTML Tidy
- Languages can now be added to Tidy using standard toolchains.
- Tidy's help output is improved with new options and some reorganization.
2016-01-30 15:51:53 +08:00
Jim Derry 933fc3d236 - Addresses #320
- Different error output depending on whether or not the `alt-text` option was given a value.
2015-11-26 13:23:43 +08:00
Geoff McLane 3f72b6e335 Issue #210 - Add new warning for summary attr in table if HTML5.
This new warning will only be seen if the document remains in HTML5 mode,
where the summary attribute is obsolete. The W3C validator flags this as
an error, and suggests 'Consider describing the structure of the table in
a caption element or in a figure element containing the table; or simplify
the structure of the table so that no description is needed'.

At the same time this patch also restored the old warning if the document
is HTML4--, if the table element lacks a summary attribute. This has been
a tidy warning since the beginning of time, although the W3C validator
does not presently flag this.
2015-06-06 11:20:35 +02:00
Geoff McLane 786b6a99a9 raft of changes to CheckHTML5, and clean 2014-08-08 17:14:28 +02:00
Geoff McLane 78c0080eb8 main code updates to do HTML5 2014-08-03 20:33:29 +02:00
Geoff McLane 39b860b1a7 Continue to remove CVS Info from source 2014-08-03 18:46:37 +02:00
Michael[tm] Smith b92d7aab88 new 2011-11-17 11:44:16 +09:00