Commit graph

106 commits

Author SHA1 Message Date
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 f49386e191
Issue #437 - re-use of 'wrap-php' option (#645)
closes #437
2020-11-22 16:44:31 +01:00
Geoff McLane 65c982f73e Is #752 - Replace _MSC_VER with _WIN32 2018-09-04 20:22:56 +02:00
Geoff McLane 94e62b24ff Is #752 - Add windows tilde expansion 2018-09-02 20:07:11 +02:00
Geoff McLane 9b076d0eca
Merge pull request #717 from ler762/doc-nits
Is #713 - Doc nits - PR #717
2018-04-24 14:41:24 +02:00
Geoff McLane 63f507b4e9
Merge pull request #705 from htacg/issue-673
Is #673 - Revert 350f7b4 and 86e62db AdjustConfig logic - Is #704 PR #705
2018-04-21 14:28:59 +02:00
ler762 8d86ed24e9 add --show-filename option to show the input filename on output messages 2018-04-13 10:25:01 -04:00
Geoff McLane ea4ae0dd13 Is #679 - some fixes for -export-config 2018-02-19 03:21:04 +01: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 6d6eb3797b Merge remote-tracking branch 'origin/keep-tabs' into complete_callbacks 2017-11-20 09:31:44 -05:00
Jim Derry 314690ad7f Option changed callback now implemented. 2017-11-20 09:27:59 -05:00
Jim Derry fcd4e90ea7 Fix issue where console app and API can't set an FPI for a doctype without
providing a quoted string. This is especially painful in a terminal, which
requires escaping quotes. Since all FPI's must start with + or -, this fixes
the issue.
2017-11-19 12:54:08 -05:00
Jim Derry ae20af4181 Added a new tidyOptionIsList() API service. 2017-11-19 12:02:24 -05:00
Jim Derry e7bacf2245 Allow all parsers to accept NULLSTR input for API consistency. 2017-11-17 21:30:19 -05:00
Jim Derry fec21eebba Merge branch 'next' into fix_doctype_option 2017-11-17 19:17:14 -05:00
Jim Derry 1dd85ad1c6 Restore alphabetical order to the options enums and structure. No version bump. 2017-11-17 19:16:58 -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
Geoff McLane 2aeb2eeb7a Issue #403 - New 'keep-tabs' option to address this. 2017-11-03 19:16:17 +01:00
Geoff McLane 4b5c86ee47 Small fix to compile with MSVC10, exposed in #636
MSVC10 2010 enforces K&R C that all variables must be declared before code
in any given context.

Unable to fix a gcc option that will expose this...

modified: src/config.c
2017-11-02 18:47:18 +01:00
Jim Derry 5fb1138840 Fixed indentation. 2017-10-29 15:04:51 -04: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 86e62dbb70 Remove unnecessary AdjustConfig logic. 2017-10-26 18:25:55 -04:00
Jim Derry 350f7b4af7 Replaced AdjustConfig() with TY_(AdjustConfig)() 2017-10-26 18:08:17 -04:00
Jim Derry aec686b1a9 Add a true "default" to TidyCSSPrefix so that it will be shown in documentation. 2017-10-26 14:24:35 -04:00
Jim Derry fc3cba86a8 I guess no one tried to use this before... it's been broken since the initial commit. We've been comparing the config value from a different option the whole time. 2017-10-25 15:04:49 -04:00
Jim Derry 4b1c048ee5 Correct configCallback logic fix. 2017-10-20 07:46:00 -04:00
Jim Derry 492c9fb74b Avoid short circuit evaluation to give new callback a chance to execute.
Version bump.
2017-10-19 20:11:26 -04:00
Jim Derry 1d91942960 Renamed the proposed squelch and squelch-id to mute and mute-id,
respectively. Updated matching cases in test branch accordingly.
2017-10-10 08:21:14 -04:00
Jim Derry 6f0ada7ffe Typo 2017-10-08 11:53:36 -04:00
Jim Derry ad03b28318 Remove @todo note. 2017-10-08 11:51:19 -04:00
Jim Derry e6f007d8ba Code spacing consistency. 2017-10-08 11:44:45 -04:00
Jim Derry f72c3d27e1 Show full prototype in forward declaration. 2017-10-08 11:40:53 -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 ab8a4249df Added squelch-id (TidySquelchShow) so that message ID's will be displayed in
the report output table. This can be used to show message ID's that the user
can use to filter against in the upcoming `squelch` option.
2017-10-07 18:10:46 -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 2e4393e37b Works for -config files now, too. 2017-10-07 11:20:57 -04:00
Jim Derry 483d17e39b Experimentally working. 2017-10-07 11:04:18 -04:00
Jim Derry 2e2062ddec WIP with functioning concept. 2017-10-06 16:14:54 -04:00
Jim Derry 4e6d76eb01 Fixed broken option callback; version bump to reflect. 2017-10-06 09:41:54 -04:00
Jim Derry 4fa26f4f5d Affects documentation only: updates the manpage (and soon the quickref) by
breaking up the existing options into several more logical categories.
2017-10-04 12:24:07 -04:00
Jim Derry 8d7e5f7f5a Documentation formatting. 2017-10-03 15:30:21 -04:00
Jim Derry e41229749c TIDY_WIN32_MLANG_SUPPORT has been dead code for ages. Not tested, not maintained. 2017-10-03 14:24:01 -04:00
Jim Derry 238b8f0a66 Wipe out dead code. We use git for a reason, so it's never really deleted. 2017-10-03 13:56:31 -04:00
Jim Derry a1e4dcc066 Removed option for SUPPORT_ACCESSIBILITY_CHECKS, regen'd strings. 2017-10-03 12:45:34 -04:00
Jim Derry dfa2501928 Removed option for SUPPORT_ASIAN_ENCODINGS, and regen'd strings. 2017-10-03 12:37:23 -04:00
Jim Derry 2758939406 Removed SUPPORT_UTF16_ENCODINGS, and regen'd strings. 2017-10-03 12:26:38 -04:00
Jim Derry a4e0409323 Address #584
Modify the build system to assume config files by default. Modify tidyplatform
to accomodate these changes. Reformat tidyplatform for friendliness to new
developers.
2017-10-01 10:37:49 -04:00
Jim Derry df3bde38ec Introduced auto behavior to the fix-bad-comments option so that yes or
`no` could be applied automatically per the document type. This is the new
default.
2017-09-25 15:26:03 -04:00
Jim Derry 483e0fec9e Address issue #476, which started out as a simple message update.
- Change default value of `--fix-bad-comments` to `no`.
  - Ensure that when _not_ fixing, nothing is actually fixed.
  - Ensure that when fixing, initial adjacent hyphens actually are fixed.
  - Issue tidyinfo for all fixes made.
  - Issue tidywarning when when not making fixes for non-HTML5 doctypes.
2017-09-24 18:15:40 -04:00
Jim Derry 64a4302e6c Migrated the attribute list parser to a general parser for future re-used by
other potential list-based options.
2017-09-23 07:30:17 -04:00