pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.24k stars 137 forks source link

Add Code Validation #1020

Closed Korb closed 3 months ago

Korb commented 3 months ago

Have you checked for existing feature requests?

Summary

The process of checking that the code is in compliance with the standards and recommendations set by the World Wide Web Consortium (W3C) for the web.

Implementation example:

When opening a document in Code view, %appname% automatically validates that the document is not using any tags, attributes, CSS properties, or CSS values that are not available in the target browsers that the user selected. %appname% underlines errors (...)

About Code validation

This feature is present in code editors such as Amaya, Arachnophilia, Bluefish, Dreamweaver, KompoZer, Microsoft Expression Web, Quanta Plus and SeaMonkey Composer.

What benefits does this feature provide?

Code validation helps to produce clean code.

Any alternatives?

  1. Duplicate a project in an application with a validation function just for the sake of using this function.
  2. Or manually check pages and their functionality in a dozen browsers.

Both options are extremely unproductive.

Upd. https://validator.w3.org/check https://jsonformatter.org/html-validator https://www.freeformatter.com/html-validator.html

Versions

Pulsar 1.117.0 x64 Microsoft Windows 10.0.19045.4474

confused-Techie commented 3 months ago

Thanks a ton for your issue!

If you're asking for linting like features to validate code as you type, I'd suggest looking into the plethora of community packages made for Pulsar.

Just searching linter in our community package's produces about 400 results. I'm sure there's something there that might fit your needs.

firednerve commented 3 months ago

Not sure if the following package provides what you require, but check it out regardless: https://web.pulsar-edit.dev/packages/w3c-validation

It is available in the package installer, go to settings->install, and type 'w3c-validation' in the search field.

Korb commented 3 months ago

atom-w3c-validation Validate your HTML and CSS file using W3C markup validator or W3C CSS validator. The package validate on save by default (you can disable this behavior in the settings). You can also use the comma,d w3c-validation:validate. Note: the validation process is made by requesting the code to the online W3C markup validator or W3C CSS validator. This can take some time.

@firednerve, this is very similar to what I need. Not as functional as a full-fledged linter, but in this case I needed the built-in validator. Thank you!