Commit graph

19 commits

Author SHA1 Message Date
Jim Derry 1bb72d6041 Spelling fixes, thanks to @jschleus. 2021-07-21 15:50:53 -04:00
Jim Derry cdc632214c Fixes 968. Will immediately backport to master 2021-07-13 15:54:26 -04:00
Jim Derry f95540b5c9 Fixed merge conflict; fixed non-build issue on macOS. RC for testing. 2021-07-10 11:13:58 -04:00
Jim Derry ef3157e0ec Fix issues with user-specified settings changing
User-specified settings were being fiddled with by tidy internally. User
settings set by the user should always be able to be read back by the
user, but `AdjustConfig()` would change them. This change contributes
toward fixing the situation by using `AdjustConfig()` at the only point
that it's needed, as well by NOT automatically reverting to the snapshot
after outputting a buffer (which should be stateless, but caused PHP to
break because it tried to save buffer more than once, so subsequent calls
would use non-fiddle settings.).
2021-07-01 16:08:37 -04:00
Geoff McLane 67eaeb6d18 Is #673 - Revert 350f7b4 and 86e62db
While these look like a code cleanup, they appear to have an adverse
consequence in the use of libtidy by PHP 7+, so have been reverted.

	modified:   src/config.c
	modified:   src/config.h
	modified:   src/tidylib.c
2018-02-14 18:54:01 +01:00
Jim Derry ae20af4181 Added a new tidyOptionIsList() API service. 2017-11-19 12:02:24 -05:00
Jim Derry e6c891ea00 Doctype made no sense! It was a write-only property in some cases, and uses
itself and DoctypeMode to make up for Tidy's ability to store only a single
value for an option. It's a little bit special relative to every single other
option, in that it's declared as a string, but also has a picklist. This change
makes Doctype behave in the way every other Tidy option behaves, and treats
Doctype as a string, but also supports selection via the picklist.
2017-11-17 08:11:22 -05:00
Jim Derry f5bdedecaf Cleanup
- Added doxygen documentation to `tags.h`
- Consistency to `tags.c` header.
- Moved TY_(DeclareUserTag) to tags.c/.h for consistency with the other list
  parsing declaratory functions.
- Merged user tags parsing into the general list, eliminating a lot of redundant
  code.
2017-10-29 14:58:02 -04:00
Jim Derry 350f7b4af7 Replaced AdjustConfig() with TY_(AdjustConfig)() 2017-10-26 18:08:17 -04:00
Jim Derry 626375346d Adds message squelching (muting) to Tidy, avoiding the need to specify a new
option every time we might want to allow or disallow new output. Adds two new
options:
  - `squelch-id` (default **no**) will provide tags during Tidy's output that
    can be used to silence warnings. For example, `MISSING_ENDTAG_OPTIONAL`
    will be shown after warnings of that type. Then in the future, the user can
    use...
  - `squelch` (default NULL) takes a list of message identification tags.
    Messages of this tag type will then be muted from output.

This gives the user great control over hiding things that he or she doesn't care
about seeing. However, muted errors/warnings still count toward error summaries.

If we merge this, then TidyShowMetaChange and TidyWarnPropAttrs are candidates
for removal (using the deprecation mechanism Tidy now has, these will continue
to work, though).
2017-10-08 10:47:03 -04:00
Jim Derry b31dd6fcc2 Added some internal structures and code to support the removal of config
options in the future, with full user notification. Right now this code is
dead, because no options have been removed. No version bump.
2017-10-07 16:11:51 -04:00
Jim Derry 6b14c559f9 Adding some documentation WIP 2017-10-07 12:14:51 -04:00
Jim Derry aeb9a24fab Refactor Picklists and Option Parsers
This PR refactors how picklists and option parsers are implemented in LibTidy,
making is vastly easier to implement new picklists in the future, as well as
modify some of the existing picklists such that they have more logical names.

Picklist arrays are now arrays of structures that include the possible strings
capable of setting a particular option value, and a new parser has been written
to work with these structures.

In addition, several of the existing parsers were removed, as they are now
redundant, and a couple of the remaining parsers were refactored to take
advantage of the new parser.

In effect, this means that:

- New parsers don't have to be written in the majority of cases where new
  options are added that exceed yes/no/auto.
- Some of the existing options can have more meaningful names than yes/no/auto,
  in a backward compatible way. For example, vertical-spacing "auto" currently
  in no way reflects "auto" when used.
2017-05-11 14:40:21 -04:00
Jim Derry 66de84bc2b - Add support for the is attribute.
- Add support for autonomous custom elements.
2017-03-13 13:45:32 -04:00
Jim Derry c54c10f857 - Removed deprecated options:
- TidySlideStyle
  - TidyBurstSlides

- Added documentation for TidyEmacsFile, since it's a valid option.

- Because TidyEmacsFile is a valid option, tweaked tidy.c so that it can
  be specified in a configuration file without being overwritten by the console
  app. Why a user might do this is dumb, but who are we to stop them.
2017-02-18 18:30:41 -05: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
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
Craig Barnes ce27a729dc Remove CVS info blocks 2012-08-08 17:27:29 +01:00
Michael[tm] Smith b92d7aab88 new 2011-11-17 11:44:16 +09:00