Skip to content
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

preserve SSI #192

Open
pacioos opened this issue Feb 25, 2015 · 2 comments
Open

preserve SSI #192

pacioos opened this issue Feb 25, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@pacioos
Copy link

pacioos commented Feb 25, 2015

I see no way of preserving server-side includes (SSI). It would be nice if there was a flag (e.g. --preserve-ssi) to tell YUI Compressor to preserve content between tags. Currently it fails with errors when it encounters these in my JavaScript files. Can somebody add this as a new feature?, or provide hints on how I might modify YUI Compressor to accomplish this?
Thanks!,
John Maurer

@tml
Copy link
Contributor

tml commented Feb 25, 2015

Wow - it never even came into my head that people might be running server-side include code through YUICompressor. Can you provide a sample file?

@pacioos
Copy link
Author

pacioos commented Feb 25, 2015

Thanks, Joey. Here is a simplified example illustrating a list of users defined: (1.) via inline JavaScript, and (2.) via an external SSI file. Each uses the browser console to dump result for testing.

// Example defining users inline:

var users = [];
var account = 'account_a';

if ( account == 'account_a' ) {
  users = [
    {
      "id": "kfarro", 
      "name": "Kyle Farro",
      "account": 1238890
    },
    {
       "id": "tmathis",
       "name": "Tom Mathis",
       "account": 5558743 
    },
    {
       "id": "vhampton",
       "name": "Violet Hampton",
       "account": 5573489 
    }
  ];
  console.info( users );
}

// Example defining users via external SSI:

var users = [];
var account = 'account_b';

if ( account == 'account_b' ) {
  <!--#include file="ssi/account_b.ssi" -->
  console.info( users );
}

This assumes that the file "ssi/account_b.ssi" contains the following JavaScript:

users = [
    {
        "id": "jsmith", 
        "name": "John Smith",
        "account": 1248972
    },
    {
        "id": "jdoe",
        "name": "Jane Doe",
        "account": 4529870
    },
    {
        "id": "kclark",
        "name": "Kerry Clark",
        "account": 2333709
    }
];

@tml tml self-assigned this Feb 25, 2015
@tml tml added the FR label Feb 25, 2015
@tml tml added this to the 3.0.0 milestone Feb 25, 2015
@tml tml self-assigned this Mar 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants