Commit graph

102 commits

Author SHA1 Message Date
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
Jim Derry bee0bf738a Merge branch 'next' into issue-729.
This brings in our regression testing again.
2021-06-30 10:04:16 -04:00
Jim Derry 64784e2582 Merge branch 'next' into issue-692 2021-06-30 09:08:04 -04:00
Geoff McLane 957ee4a47e
Is. #681 - read-only files, and dirs (#926)
Tested in 3 majors OS'es... no problems... closes #681
2021-04-14 18:02:09 +02:00
Geoff McLane 68c70ae53a Is. #746 PR #747 - fix other dup 'const' modifier 2019-01-14 19:46:10 +01:00
Geoff McLane 937d67c313 Is. #770 #780 maybe #790 - remove 'setlocal' from lib! 2019-01-08 14:52:13 +01:00
林博仁(Buo-ren Lin) 88b99acdd6 Is. #783 - Fix language detection
The `setlocale` call doesn't return a single locale name in glibc when
any of the locale category variable has a different value, instead it
returns a composite locale name which is a concatenation of the entire
list of locale name and its values, causing the language detection fail.

This patch attempts to set the language via LC_MESSAGES and LANG
environment variables which are commonly used in POSIX-like systems,
then fallbacks to `setlocale` as the last resort.
2018-12-03 22:21:14 +08:00
Geoff McLane 817ef6446c Is #729 - Show 'warnings' in all cases 2018-05-14 20:51:59 +02:00
Geoff McLane 8d5ff2c514 Is #692 - Add a 'CleanHead' service 2018-03-27 15:36:15 +02: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
Geoff McLane ccde058772 Is #663 - Open context for gcc 2.95 port 2017-12-25 03:26:53 +01:00
Geoff McLane 7f9e02b2fb Is #663 - Small change for MSVC10 2017-12-23 17:36:05 +01:00
Jim Derry 314690ad7f Option changed callback now implemented. 2017-11-20 09:27:59 -05:00
Jim Derry ae20af4181 Added a new tidyOptionIsList() API service. 2017-11-19 12:02:24 -05:00
Jim Derry 8ddc0105f9 Add missing iterators for recently added options mute and priority attributes. 2017-11-19 10:21:46 -05:00
Jim Derry 2957cb135b Moved orphans from attrapi.c to tidy.c; eliminate attrapi.c. This only affects internal binary representation, but there's not API change, so no version bump. 2017-11-17 21:39:30 -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 57f623eb7c Updated PR to make LIBRARY default to the environment language, rather than just console tidy. 2017-10-31 17:41:32 -04:00
Jim Derry cc023c26b7 Address #639. 2017-10-30 07:53:35 -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 6d8d153143 Merge pull request #630 from jokester/close-stdin-after-parse
close stdin and free its FileSource in tidyDocParseStdin
2017-10-19 17:41:00 -04:00
Jim Derry 9c96551fe0 Merge branch 'issue-604' into next 2017-10-19 17:37:22 -04:00
Jim Derry 93957e4b17 Merge pull request #629 from htacg/squelch_reports
Squelch reports
2017-10-19 17:21:37 -04:00
Jim Derry 2340e63f8b Expose the platform name to the public API. 2017-10-19 17:11:29 -04:00
Geoff McLane 3b154dc407 Issue #604 - Try to fix. Initial cut. WIP 2017-10-13 20:50:53 +02:00
Wang Guan dacb63da31 close stdin and free its FileSource in tidyDocParseStdin 2017-10-14 02:44:33 +09: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 346ba063c9 Expose the new property to the public API. 2017-10-08 12:03:48 -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 0977aa6077 Removed dependency on NDEBUG, and introduced ENABLE_DEBUG_LOG in CMakeLists.txt.
By default Windows will continue to show SPRTF output, and other platforms will
require the -DENABLE_DEBUG_LOG to be set in default (debug) configurations.

Debug and Release builds on macOS, Windows 10, and Ubuntu 16.04 confirmed
working as most people expect.
2017-10-07 14:56:01 -04:00
Jim Derry fa30773938 Centralize control of message output to the messageOut() method in order to:
- Prevent the message filter from missing possible messages due to dispered
    control.
  - Single decision point for the types of messages to be output given current
    conditions and options settings.
2017-10-05 15:04:22 -04:00
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 4e3c1a1562 Move all of the sprtf includes into tidyplatform.h 2017-10-03 20:42:29 -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 9679d88fae Format macros nicely. 2017-10-03 14:14:59 -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 2758939406 Removed SUPPORT_UTF16_ENCODINGS, and regen'd strings. 2017-10-03 12:26:38 -04:00
Geoff R. McLane 5c224e4a70 Revert 6 files to 0664 2017-09-28 18:43:52 +02:00
Jim Derry 70681131d6 New config option now drives the list; memory deallocated. 2017-09-23 07:20:31 -04:00
Jim Derry 23c28e5b82 Initial commit of #434; WIP 2017-09-22 22:14:59 -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 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 e5a05ae5a8 Address merge conflicts. 2017-08-31 13:15:28 -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 1562c42c2e Merge branch 'next' into issue-456
Manually fixed merge commits.
2017-08-28 15:17:10 -04:00
Jim Derry 561d43c7e5 Merge pull request #579 from htacg/issue-567-2
Issue 567 2 - style tag to head
2017-08-28 10:02:25 -04:00
Jim Derry f4c64966f0 Added TidyConfigCallback and deprecated TidyOptCallback for consistency with
the remainder of the callbacks. TidyConfigCallback is now given a reference
to the instance of the TidyDoc that caused the callback to occur.

+    TidyConfigCallback
2017-08-26 12:47:18 -04:00