-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format code #105
Comments
When you are using the hth |
@phax can you send demo java code? |
Great, there is only one problem, when I try to sort the properties, it does not respond, sample code h1{
color:red;
} What I have in mind h1{
color: red;
} |
There is currently no way to customize the output with additional blanks or so - sorry |
@phax I have a question that has been bothering me. What should I do to parse CSS3 code, for example to get lines and columns? |
To read with line and column, you need to provide a |
Is there a code sample for that?
در تاریخ یکشنبه 26 ژانویه 2025، 22:04 Philip Helger <
***@***.***> نوشت:
… To read with line and column, you need to provide a CSSReaderSettings
object to your CSSReader.
Inside the CSSReaderSettings object you have to call
.setUseSourceLocation(true)
—
Reply to this email directly, view it on GitHub
<#105 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIZXRFWHGS2YJUIBCLTEKR32MUTCRAVCNFSM6AAAAABVLVWEJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJUGU2DCMBSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@HanzoDev1375 I created a small sample for you |
@phax good code my code void cssrun() {
String cssCode = binding.editor.getText().toString();
CascadingStyleSheet sheet =
CSSReader.readFromStringReader(cssCode, new CSSReaderSettings().setUseSourceLocation(true));
CSSStyleRule rule = (CSSStyleRule) sheet.getAllStyleRules();
List<CSSStyleRule> rl = new ArrayList<>();
rl.add(rule);
rl.forEach(
i -> {
var is = i.getSourceLocation().getLastTokenBeginLineNumber();
var is2 = i.getSourceLocation().getLastTokenEndLineNumber();
var builder = new StringBuilder();
builder.append("Line: ").append(is).append('\n');
builder.append("Col: ").append(is2).append("\n");
Toast.makeText(getApplicationContext(),builder.toString(),2).show();
});
} not work me I am getting a runtime error, which is a class casting error. |
hello how to format code by in library??
The text was updated successfully, but these errors were encountered: