Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Align javascripts with their <SCRIPT> tag.

  • Loading branch information...
commit faeb8e5a0b31d03f2bd8fba1c338ba3c89d4be6a 1 parent 89aba47
@mikeabdullah mikeabdullah authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 KSHTMLWriter.m
View
14 KSHTMLWriter.m
@@ -309,11 +309,13 @@ - (void)writeJavascriptWithSrc:(NSString *)src charset:(NSString *)charset; // s
- (void)writeJavascript:(NSString *)script useCDATA:(BOOL)useCDATA;
{
[self startJavascriptElementWithSrc:nil];
-
- if (useCDATA) [self startJavascriptCDATA];
- [self writeHTMLString:script];
- if (useCDATA) [self endJavascriptCDATA];
-
+ {{
+ if (useCDATA) [self startJavascriptCDATA];
+ [self writeHTMLString:script];
+ if (useCDATA) [self endJavascriptCDATA];
+
+ [self increaseIndentationLevel]; // compensate for -decreaseIndentationLevel
+ }}
[self endElement];
}
@@ -334,10 +336,12 @@ - (void)startJavascriptElementWithSrc:(NSString *)src; // src may be nil
else
{
// Embedded scripts should start on their own line for clarity
+ // Outdent the script comapred to wha'ts normal
[self startElement:@"script" writeInline:NO];
if (!src)
{
+ [self decreaseIndentationLevel];
[self startNewline];
[self stopWritingInline];
}
Please sign in to comment.
Something went wrong with that request. Please try again.