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

Warning: String-valued property starts with quote but doesn't end with quote #285

Closed
Intelligent2013 opened this issue Apr 18, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Intelligent2013
Copy link
Contributor

Source: #283

Warnings occur for asciimath text:

[mn2pdf] String-valued property starts with quote but doesn't end with quote: "C"_2"H"_2
[mn2pdf] String-valued property starts with quote but doesn't end with quote: "I"_2
[mn2pdf] String-valued property starts with quote but doesn't end with quote: "v"_1 + "v"_3
[mn2pdf] String-valued property starts with quote but doesn't end with quote: "v"_1 + "v"_3
[mn2pdf] String-valued property starts with quote but doesn't end with quote: "v"_1 + "v"_3 + "v"_4 + "v"_5
@Intelligent2013 Intelligent2013 added the bug Something isn't working label Apr 18, 2023
@Intelligent2013 Intelligent2013 self-assigned this Apr 18, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Apr 18, 2023
@Intelligent2013 Intelligent2013 moved this from 🆕 New to 🏗 In progress in Metanorma Apr 18, 2023
@Intelligent2013
Copy link
Contributor Author

The message from java\org\apache\fop\fo\properties\StringProperty.java:

        /**
         * Make a new StringProperty object
         * @param propertyList not used
         * @param value String value of the new object
         * @param fo not used
         * @return the StringProperty object
         */
        public Property make(PropertyList propertyList, String value,
                             FObj fo) {
            // Work around the fact that most String properties are not
            // specified as actual String literals (with "" or '') since
            // the attribute values themselves are Strings!
            // If the value starts with ' or ", make sure it also ends with
            // this character
            // Otherwise, just take the whole value as the String
            int vlen = value.length() - 1;
            if (vlen > 0) {
                char q1 = value.charAt(0);
                if (q1 == '"' || q1 == '\'') {
                    if (value.charAt(vlen) == q1) {
                        return new StringProperty(value.substring(1, vlen));
                    }
                    log.warn("String-valued property starts with quote"
                                       + " but doesn't end with quote: "
                                       + value);
                    // fall through and use the entire value, including first quote
                }
                String str = checkValueKeywords(value);
                if (str != null) {
                    value = str;
                }
            }
            return StringProperty.getInstance(value);
        }

@Intelligent2013
Copy link
Contributor Author

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant